While search engines didn't exist back then, books of that era had these kinds of titles for similar reasons: they were a way of turning the book's cover into a piece of marketing. Books with long titles could explain their appeal to shoppers without requiring them to pick up the book and open it.
Interestingly, one of the things that may have led to titles getting shorter in the 19th century may be the advent of serialized fiction: as printing technology became more widely available, many famous stories like The Count of Monte Cristo and the early works of Charles Dickens were published chapter-by-chapter in weekly publications (quite similar to how manga are published in weekly magazines like Shounen Jump), and if you had an extra-long title that took up half a page every week, it would add to the printing cost in a non-trivial way.