Querying for length of document

Hi,

I have documents indexed like this:

"words": "Yellow dogs are barking"

The example above has four tokens. While querying now via matchPhrase, is it possible to set a minimum of tokens which should be in the document? (Its not an array).

Thanks a lot,

Tom

Welcome to our community! :smiley:

Does minimum_should_match parameter | Elasticsearch Guide [8.2] | Elastic look like it would do what you want?

Thanks, but it does not qork:

"reason": "[match_phrase] query does not support [minimum_should_match]",

My query:

{
"query": {
"match_phrase": {
"token": {
"query" : "Salz und Pfeffer",
"minimum_should_match" : 20,
"slop" : 3
}
}
},
"_source": true,
"size" : 10

}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.