So I have a task to make some kind of type-ahead using Lucene 6. Basic requirements:
Queries should match partial words, not whole tokens. If I have "sum of sales" string indexed then query "sum of sa" should match.
Relevancy should come out of the box or be easy to implement. Matches from start of the indexed string should have higher score that ones with match in the middle. Full match has highest score. Etc.
So far i've tried:
PhraseQuery which has acceptable relevancy from out of the box, but does not match partial words.
Combining PhraseQuery for all words in query and WildcardQuery for last(possibly incomplete word) using BooleanQuery. This will match those two parts in any order. So isn't good for me.
Indexing separate copy of a field without tokenizing and using PrefixQuery and WildcardQuery. They don't give scoring I would like to have from out of the box.
Is there any approach I missed that could save my day and possibly next week?