But I didn't found an equivalent of this "contains"-search. I know there are term-Queries which should only match the exact given string but I didn't found out how I could pass multiple fields with a wildcard to it.
Wow. Are these the standard analyzers? Do I really need "stop", "keywords" and "stemmer" if I want them to work like the default language analyzers? Because my product can be used in many languages, I would need to save all these analyzers listed there...
And even if I would use the ngram-analyzer I still don't find a query where I can hand over multiple wildcard-fields but an exact-query. Do you have one in mind?
I am sorry I still don't get it. Wouldn't that only boost the importance of one field and not the matching of the query-string? I tried the "fuzziness" paramter in a Query String Query by now but that still finds "Müller" when I want to search exactly for "Müll" =/
Hm well maybe I should have added: That value is most likely to occur only in one field. I only pass multiple fields because I cannot be sure in which field the value is saved exactly.
I just wanted to post an update: I thought a solution would be to search on the "keyword" field, yet it doesn't work when the field has a space in it. Is it possible to do this somehow?
Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.
What I am searching for now is a query that returns EXACTLY "basket" and where I can pass multiple field-names with wildcards in them (because under "path.test" can be multiple fields)
The reproduction script you shared exactly returns the document that contains exactly basket. And you have one single field in your example.
So I don't know what you are looking for.
If I run this in an elastic search verison 5.6.4 I get both "basket" and "baskteball" as return.
I tried to keep the example as short as possible and only wanted to remind that I need to pass "fields" and not just a single "field" to the query, because there are some queries that only allow one field, like the prefix-query for example. I will update my previous post to better demonstrate this.
I thought maybe using the keyword field would do the work, but it doesn't work with "basket of apples". When searching for this exact value, "basket" is returned instead of the expected doc.
You are searching for exact match as you want to search within a keyword type field.
You are searching for basket and only document which match exactly basket is returned.
So I'm not sure about what you are searching for.
If I'm understanding, searching for basket should return basket and basket of apples? Is that right?
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.