flask-msearch icon indicating copy to clipboard operation
flask-msearch copied to clipboard

[Feature Request] - Return whoosh result object along with each result

Open veeshi opened this issue 4 years ago • 2 comments

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

veeshi avatar Aug 25 '20 10:08 veeshi

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)

honmaple avatar Sep 07 '20 14:09 honmaple

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

veeshi avatar Oct 02 '20 10:10 veeshi