Skip to content
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

Merged
merged 6 commits into from
Jul 29, 2019
Merged

Conversation

jrodewig
Copy link
Contributor

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.

@jrodewig jrodewig added :Search/Search Search-related issues that do not fall into other categories >docs General docs changes v7.0.2 v7.1.2 v7.2.2 v7.3.1 v7.4.0 v8.0.0 labels Jul 26, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jrodewig jrodewig marked this pull request as ready for review July 26, 2019 17:37
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs

Copy link
Contributor

@mayya-sharipova mayya-sharipova left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space before "The"

Copy link
Contributor Author

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`.
Copy link
Contributor

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

Copy link
Contributor Author

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.
Copy link
Contributor

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."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-added with 232a365.

@jrodewig jrodewig merged commit 45be909 into master Jul 29, 2019
@jrodewig jrodewig deleted the distance-feature-query branch July 29, 2019 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search/Search Search-related issues that do not fall into other categories v7.2.2 v7.3.1 v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants