Skip to content

[DOCS] document replacement for search exists #14393

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

Merged
merged 1 commit into from
Nov 9, 2015

Conversation

javanna
Copy link
Member

@javanna javanna commented Oct 30, 2015

Search exists api was removed from master and deprecated in 2.x. With this PR we document how the same can be achieved using the search api.

Relates to #13910

@javanna
Copy link
Member Author

javanna commented Oct 30, 2015

@clintongormley can you have a look please? also, I am not sure where this new section should go, probably not where I added it :)

is the `total_hits` field that tells us how many documents matched the query,
before the query was terminated. Also if the query was terminated early, the
`terminated_early` flag will be set to `true` in the response.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm being captain Obvious, but it could be worth just saying that a total hit count equal to 0 means that there are no matches, while a count greater than 0 means that there are matches?

@javanna javanna force-pushed the docs/search_exists branch from 7c20db0 to b1201fc Compare October 31, 2015 08:15
@javanna
Copy link
Member Author

javanna commented Oct 31, 2015

@jpountz pushed a new commit, thanks for having a look.

$ curl -XGET 'http://localhost:9200/_search?q=tag:wow&size=0&terminate_after=1'
--------------------------------------------------

The response will not contain any hit as the `size` was set to `0`. The
Copy link
Contributor

Choose a reason for hiding this comment

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

any hitS

@clintongormley
Copy link
Contributor

Yeah, its current position feels too important. How about adding a section called terminate_after in the request body section, and putting the docs on there (along with the docs for terminate after that are currently on https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html)

@javanna javanna force-pushed the docs/search_exists branch from b1201fc to a17221a Compare November 9, 2015 13:21
@javanna
Copy link
Member Author

javanna commented Nov 9, 2015

@clintongormley I pushed a new commit, can you double check please?

@clintongormley
Copy link
Contributor

LGTM

@javanna javanna force-pushed the docs/search_exists branch from a17221a to ca980b7 Compare November 9, 2015 14:05
@javanna javanna merged commit ca980b7 into elastic:master Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants