Add document retrieval functionality to searchbar
Closed this issue · 3 comments
Ceasar commented
There are at least two reasons to implement document retrieval:
- When a search fails, the response is an unhelpful 404. It would be more useful to the user to perform a document retrieval query, since presumably the user will not be too far off and could likely just click the right result.
- Sometimes the user forgets where he stored a page describing a topic, perhaps because he combined stub articles together without adding anchors.
This would also eliminate the need to use the index (with its aliases) in the autocomplete results.
Ceasar commented
I've rewritten the search logic. With a few slight modifications, it should be possible to do this quickly (and also use the results to generate typeahead suggestions).
Ceasar commented
This may be helpful. https://pythonhosted.org/Whoosh/indexing.html#incremental-indexing