Whereas a phrase query simply excludes documents that don’t contain the exact
query phrase, a proximity query—a (((“proximity matching”, “proximity queries”)))(((“slop parameter”, “proximity queries and”)))phrase query where is greater
than 0
—incorporates the proximity of the query terms into the final
relevance _score
. By setting a high slop
value like or 100
, you can
exclude documents in which the words are really too far apart, but give a higher
score to documents in which the words are closer together.
The following proximity query for quick dog
matches both documents that
contain the words quick
and , but gives a higher score to the
document(((“relevance scores”, “for proximity queries”))) in which the words are nearer to each other:
// SENSE: 120_Proximity_Matching/20_Scoring.json
<1> Note the high slop
value.
<1> Higher score because quick
and dog
are close together
<2> Lower score because and dog
are further apart