Hi all, I am new to Elastic App Search. I am using @elastic/app-search-javascript 7.6.0 to do the search. When I tried to search "Food 1" (without quote, I don't want do have an exact search), I got all the documents with "1" as well. How to deal with this?
I tried to use minimum_should_match from query_string like this as from Elasticsearch document
It looks like you are mixing Elasticsearch query syntax with App Search syntax. Make sure you are querying with the App Search search syntax described here: Search API | Swiftype Documentation.
When I tried to search "Food 1" (without quote, I don't want do have an exact search), I got all the documents with "1" as well. How to deal with this?
This sounds like the expected behavior to me. What were you expecting?
Thanks @JasonStoltz for the getting back to me. I just want to get rid of some unexpected results. When I search for Food 1, all the unexpected documents with just "1" (could be the same with stopwords such as "a", "the"?) are included. It would be great if you can suggest for a solution.
Also any option to search with AND operator rather than OR by app search?
I don't think you can define "1" as a stopword, to do something like that I'd try indexing an alternate version of your fields that have numbers stripped out, which you could use for searching.
Thanks @JasonStoltz, At first I thought App search api is would be wrapper for Elastic search rest api, but looks like its not. The option to search is very limit.
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.