Skip to content

Near Query

Edit page

Another commonly used operator is _near, which finds terms near each other in the current document, behaving like _and with regard to weights, so that:

  • Documents which match A near B are matched, with weight of A+B

The window is 10 + the number of words - 1 positions (11 for two words); NEAR/n in a text under _and or _or sets n. The operands must be plain words: a wildcard, a fuzzy word or a group inside _near answers 400.

SEARCH /bank/
{
"_query": {
"personality": {
"_near": "adventurous creative"
}
}
}