Answer the question
In order to leave comments, you need to log in
How to search phrases in elasticsearch with fuzzy?
I have an elastic base, there is data there, and such an index setting
index_ru:
type: custom
tokenizer: standard
filter: [word_delimiter, lowercase, stopwords_ru, stop, russian_morphology, english_morphology, unique]
char_filter: [html_strip]
search_ru:
type: custom
tokenizer: standard
filter: [word_delimiter, lowercase, stopwords_ru, stop, russian_morphology, english_morphology, unique]
char_filter: [html_strip]
{
"query": {
"filtered": {
"query": {
"match": {
"fullText": {
"query": "российская федерация",
"fuzziness": "AUTO",
"operator": "and",
}
}
},
"filter": {
"range": {
"pubDate": {
"gte": "2015-08-03"
}
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
{
"query": {
"filtered": {
"query": {
"span_near" : {
"clauses" : [
{
"span_multi": {
"match": {
"fuzzy": {
"fullText": {
"fuzziness": "AUTO",
"value": "российская"
}
}
}
}
},
{
"span_multi": {
"match": {
"fuzzy": {
"fullText": {
"fuzziness": "AUTO",
"value": "федерация"
}
}
}
}
}
],
"slop" : 2,
"in_order" : true,
"boost" : 20
}
},
"filter": {
"range": {
"pubDate": {
"gte": "2015-01-01"
}
}
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question