flask-msearch
flask-msearch copied to clipboard
[Feature Request] - Return whoosh result object along with each result
It would be useful to have an option to return the whoosh result object along with each result.
One use case is so we can then at a later stage highlight the matched terms in each result.
Whoosh Documentation - “Did you mean... ?” Correcting errors in user queries
For convenience, flask-msearch
always return a Model
, if you want to use origin whoosh syntax, you can use
search = Search()
....
search.msearch(Post, "apple", fields=None, limit=None, or_=True)
Apologies, I'm interested in the whoosh.searching.Results and whoosh.searching.Hit objects so I can view which search terms matched and highlight the matching terms in the results. References: Which terms from my query matched? How to create highlighted search result excerpts