So while querying the above with "john apple" or "john applebau" (which would be quite common in the in-app live searches), "John Aaron" would get the best score, pushing "John Applebaum" down on the list (in my use-case outside of a first page). I've tried to use wildcards, AND/OR operators or similar, but it seems not to help at all.
Of course the example is trivial, but from the user perspective it means that entire keyword needs to be typed in to affect the search. I am aware that query suggestion can be used to simplify that, but in my use case this is not a preferred way to input data. What would you recommend?
I reproduced the issue you're having. Unfortunately, there aren't any settings to tweak the search query to score the partially matched Applebaum higher.
You could index the documents using first and last names separately, e.g.: [{"first": "John", "last": "Mayer"}, {"first": "John", "last": "Aaron"}, {"first": "John", "last": "Applebaum"}]
Then, in App Search relevance tuning, increase the weight of last name higher than first name. This will make your specific example work:
But this may cause the same problem to happen in reverse: a partial match on a first name may not return the desired result now.
App Search applies many indexing strategies to your documents by default, including edge ngrams. The App Search indexing strategies make most searches work intuitively out of the box. But these indexing strategies and search query settings don't cover all cases perfectly.
Well, the specific example was just to reproduce the issue easily
We're doing a product which helps people with diabetes to better control their diet - the search in the app is used to add ingredients while preparing every day meals.
The issue would be, that while searching for "cheese cottag" the user would have to browse through 2 pages of "Cheese, Roquefort", "Cheese, Gruyere" etc. before reaching to "Cheese, Cottage" (which is terrible in terms of UX). Since the name of a product might be structured differently ("Carrot", "Rice, Brown", "Paprika Chips LAYS"), the idea of splitting it as in name/last name example does not make much sense.
I wonder if there's any supported way to use wildcards (as it would be in the pure Elastic Search API), or somehow tune the search results. We haven't found anything yet, so we'd rather skip the App Search as a preferred solution
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.