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

Deprecate _search/exists in favour of regular _search with size 0 and terminate_after 1 #13910

Merged
merged 1 commit into from
Oct 21, 2015

Conversation

javanna
Copy link
Member

@javanna javanna commented Oct 2, 2015

Deprecate _search/exists in favour of regular _search with size set to 0 and terminate_after set to 1.

Relates to #13682

@javanna javanna added :Search/Search Search-related issues that do not fall into other categories v2.1.0 >deprecation review labels Oct 2, 2015
@clintongormley
Copy link
Contributor

Nice. Perhaps add a section to the search API docs entitled "Fast check for any matching docs" or similar?

@jpountz
Copy link
Contributor

jpountz commented Oct 2, 2015

+1 on documenting this "recipe"

@s1monw
Copy link
Contributor

s1monw commented Oct 17, 2015

+1 maybe @debadair can help documenting that?

@javanna javanna added the v2.2.0 label Oct 19, 2015
@javanna
Copy link
Member Author

javanna commented Oct 19, 2015

I pushed a new commit to log a deprecation warning when search exists is used. Agreed on the additional documentation needed, I would open a follow-up PR though as that one would need to go to master too. Is that ok?

@jpountz
Copy link
Contributor

jpountz commented Oct 21, 2015

LGTM

@@ -634,16 +634,19 @@ public CountRequestBuilder prepareCount(String... indices) {

@Override
public ActionFuture<ExistsResponse> exists(final ExistsRequest request) {
deprecationLogger.deprecated("search exists api is deprecated and will be removed in the next major version, use search with size set 0 and terminate_after set to 1 instead");
Copy link
Contributor

Choose a reason for hiding this comment

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

s/set 0/set to 0/ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch

@javanna javanna force-pushed the deprecation/search_exists branch from 2896974 to e7e09e2 Compare October 21, 2015 13:30
@javanna javanna merged commit e7e09e2 into elastic:2.x Oct 21, 2015
javanna added a commit to javanna/elasticsearch that referenced this pull request Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>deprecation :Search/Search Search-related issues that do not fall into other categories v2.1.0 v2.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants