I'm writing the text search app for some internal tool, so looking for some simple solution which doesn't require index-time changes (so not looking at N-gram indexing yet).
Let's say we have two documents with titles of same length
"Good document about everything around"
"Not Good but bad document"
Search phrase is "very good document".
Goal is to return both documents (i.e. allow partial match, as they don't have "very"), but also to boost "Good document about everything around" higher because "good document" are adjacent there.
In order to support boost by adjacent words match, it is usually recommended to use match_phrase with slop. But it doesn't work in my case, because it doesn't allow partial match (doesn't allow to omit "very").
Why don't you create a boolean query, with clauses for match_phrase with slop and another match clause that would hit on your partial matches? You can experiment with minimum_should_match and if scoring is an issue you can also wrap it in a dis_max query.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.