-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOCS] Reformat distance feature query #44916
Conversation
Pinging @elastic/es-search |
Pinging @elastic/es-docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @jrodewig
[[distance-feature-query-distance-ex]] | ||
====== Boost documents based on location | ||
The following `bool` search returns documents with a `name` value of | ||
`chocolate`.The search also uses the `distance_feature` query to increase the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space before "The"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. Fixed with 6ff193d.
Unlike the <<query-dsl-function-score-query,`function_score`>> query or other | ||
ways to change <<query-filter-context, relevance scores>>, the | ||
`distance_feature` query efficiently skips non-competitive hits when the | ||
<<search-uri-request,`track_total_hits`>> parameter is `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is NOT set to true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with 20a0492.
a `number+date unit` ("1h", "10d",...) for date and date_nanos fields, | ||
and a `number + geo unit` ("1km", "12m",...) for geo fields. | ||
Boosts the <<query-filter-context, relevance score>> of documents closer to a | ||
provided `origin` date or point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is important to include some variation of the below paragraph, as to my mind it nicely highlights the main usage for this query:
"For example, use this query if you want to give more weight to documents with dates closer to a certain date, or to documents with locations closer to a certain location."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-added with 232a365.
Updates the
distance_feature
query to use the new query format.This creates separate sections for the example requests, parameters, and notes.
This is part of #40977, an effort to standardize documentation for query types.