O
O
Oleg-Ukraine2017-09-13 15:56:29
elasticsearch
Oleg-Ukraine, 2017-09-13 15:56:29

Exact match for the phrase ElasticSearch?

How to find documents in ElasticSearch in which the required field is present and exactly matches the search value (no longer, no shorter).
match, match_phrase - similar to like in its different variations.
terms (at least out of the box) does not process fields with separators like (-) and there are problems with searching in camelcase, perhaps this can be somehow bypassed, if so, I would be grateful for advice.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cheremisin, 2017-09-13
@Oleg-Ukraine

Elastic has a set of filters in the analyzer, linked in the mapping, which separate words into terms and convert them to one form. For example, from the word "IBM-xStation" make two terms "ibm" and "xstation". And if you are searching by terms, then you need to consider how the words themselves are broken into them.
If you are not satisfied with the standard thermal generation, then you can always change it, for example, by canceling the reduction to lower case and considering the dash as part of the word.
In general, throw your mapping here, and we will see what you want to get as a result.
Well, read it yourself - https://www.elastic.co/guide/en/elasticsearch/ref...

U
un1t, 2017-09-13
@un1t

You need to configure the mapping for this field by specifying analyzer=keyword, and then filter through term.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question