I'm working on search autocomplete using Hibernate Search. My database has fields which contains a few words. Currently I'm using EdgeNGramFilterFactory, search works excellent and return whole field. However I'd like to have only the words which were matched during search in the result (a bit similar to autocomplete on google). Is this possible to achieve using Hibernate Search?
Example:
Database have rows containing following texts:
- "fix grammatical or spelling errors"
- "clarify meaning without changing it"
- "correct minor mistakes"
Somebody writes "fix gr" to the search field. As a result I'd like to have "fix grammatical" instead of whole line "fix grammatical or spelling errors"