Skip to content

Remove search-exists API #13682

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

Closed
clintongormley opened this issue Sep 21, 2015 · 13 comments
Closed

Remove search-exists API #13682

clintongormley opened this issue Sep 21, 2015 · 13 comments
Assignees
Labels
:Search/Search Search-related issues that do not fall into other categories

Comments

@clintongormley
Copy link
Contributor

The search-exists API tells you if there are any matching results, without performing a count. Besides this being an almost-never-useful operation, it could easily be replicated with:

GET _search?size=0&terminate_after=1

I propose removing this API.

@clintongormley clintongormley added discuss :Search/Search Search-related issues that do not fall into other categories v2.1.0 labels Sep 21, 2015
@nik9000
Copy link
Member

nik9000 commented Sep 21, 2015

I propose removing this API.

I'm certainly fine with it. I've never used it in production.

@javanna
Copy link
Member

javanna commented Sep 22, 2015

+1

@bleskes
Copy link
Contributor

bleskes commented Sep 22, 2015

Will we also wire HEAD _search to do the same and add terminate_after?

On 22 Sep 2015, at 10:10, Luca Cavanna [email protected] wrote:

+1


Reply to this email directly or view it on GitHub.

@clintongormley
Copy link
Contributor Author

@bleskes no - some clients don't support HEAD with body. I don't see the need for sugar here

@bleskes
Copy link
Contributor

bleskes commented Sep 22, 2015

I don’t follow the logic? if you do submit a head a request, why not make sure return as fast as possible with the information needed (this is something there).

On 22 Sep 2015, at 15:21, Clinton Gormley [email protected] wrote:

@bleskes no - some clients don't support HEAD with body. I don't see the need for sugar here


Reply to this email directly or view it on GitHub.

@honzakral
Copy link
Contributor

Also do we add/leave this functionality in the client as a shortcut? There is a precedent to it with the create API that is just index with op_type=create.

@clintongormley
Copy link
Contributor Author

@bleskes first, i have never heard of anybody using this feature, and can't come up with a real use case for it anyway. Second, not all clients can support it. Third, it is easy to replicate the functionality by just setting ?size=0&terminate_after=1

@honzakral I would say we don't bother supporting it in the client as the feature is really not useful.

@bleskes
Copy link
Contributor

bleskes commented Sep 22, 2015

first, i have never heard of anybody using this feature, and can't come up with a real use case for it anyway.

I was asked about it a while ago. Not sure if the use case at the time. The one I can think of out of the top of my had is wanting to validate that a search link will actually lead to results - for example a "did you mean" recommendation link (which may come from the completion suggester or another system).

Second, not all clients can support it

Those that do can, and those don't can't. Just like GET with a body imho. As you say, it's not in your way if you can't.

All I wanted is to make sure this gets some attention. It's super easy to implement on the ES side (and we don't now) and to me is what I would expect from a HEAD _search request. If you rather not do but wait for an, eventual, feature request - it's good with me.

@clintongormley
Copy link
Contributor Author

Another good reason for removing search-exists: #13094

@javanna javanna self-assigned this Oct 2, 2015
@javanna
Copy link
Member

javanna commented Oct 2, 2015

I am looking into this. I think we may want to make terminate_after non experimental before using it as a replacement for apis that we are removing. Any reasons why terminate_after is still experimental in our docs?

@jpountz
Copy link
Contributor

jpountz commented Oct 2, 2015

I think it has been made experimental because it was initially used by suggesters. But then we deprecated the limit filter in favour of it and now we are thinking of doing the same for the search/exists API, so it probably makes sense to remove the experimental flag.

@honzakral
Copy link
Contributor

@clintongormley do you have any data why you are saying it's not useful? People are using it and asking questions around it. Due to it's inconsistencies (#11204) more than about any other API.

@clintongormley
Copy link
Contributor Author

@honzakral i don't have data, just instinct (which may well be wrong). However, this is a really simple function that can be entirely replaced by the search API, which is much more thoroughly tested (and much more widely used). My goal here is to reduce the surface area of these APIs to make the code base easier to maintain and test.

You're free to add a convenience method to the python API if you feel strongly about it.

@javanna javanna removed the v2.1.0 label Oct 19, 2015
@clintongormley clintongormley added help wanted adoptme and removed discuss labels Oct 21, 2015
javanna added a commit to javanna/elasticsearch that referenced this issue Oct 21, 2015
javanna added a commit that referenced this issue Oct 21, 2015
javanna added a commit to javanna/elasticsearch that referenced this issue Oct 21, 2015
@javanna javanna removed the help wanted adoptme label Oct 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

6 participants