I have a document with name field containing "CT17 TRANSPARENT GRUNT 2L HENKEL" text. I'm trying to do match_bool_prefix query and I've got weird results.
If i search for "ct17 grunt hen" it gives me this document.
Same with "ct17 grunt henk" and "ct17 grunt henkel"
But "ct17 grunt henke" returns no results.
I ran these queries with profile: true option and it looks like for phrase "henke" it creates synonym query instead of prefix:
+name:ct17 +name:grunt +Synonym(name:henk name:henke)
Why is it doing that? How to prevent creating this SynonymQuery and leave prefix?
Certainly there is synonym used, but I think behaviour of engine is wrong. When I use match_bool_prefix I expect last term is used for partial match. But in this case engine found synonym and replaces partial match with exact match of term "henke" and its synonyms.
Probably it would be better if this query resolves to something like +name:henke* OR +Synonym(name:henk name:henke)
You're right that if the behavior is inconsistent that's probably a bug.
The issue that I'm running into, is that I can't duplicate this problem right now. Here's a sample script that I used on 8.15.2, but both the match_bool_prefix and bool queries perform exactly the same.
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.