Fix page title indexing

Page titles should be indexed too!

Refactor `get_search_data` to avoid unnecessary string concatenation, which is wasteful and produces unexpected spaces in the output.