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

[Remove] Type from Percolate query API #2490

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@ public void testPercolatorQueryExistingDocument() throws Exception {

logger.info("percolating empty doc");
SearchResponse response = client().prepareSearch()
.setQuery(new PercolateQueryBuilder("query", "test", "type", "1", null, null, null))
.setQuery(new PercolateQueryBuilder("query", "test", "1", null, null, null))
.get();
assertHitCount(response, 1);
assertThat(response.getHits().getAt(0).getId(), equalTo("1"));

logger.info("percolating doc with 1 field");
response = client().prepareSearch()
.setQuery(new PercolateQueryBuilder("query", "test", "type", "5", null, null, null))
.setQuery(new PercolateQueryBuilder("query", "test", "5", null, null, null))
.addSort("id", SortOrder.ASC)
.get();
assertHitCount(response, 2);
Expand All @@ -424,7 +424,7 @@ public void testPercolatorQueryExistingDocument() throws Exception {

logger.info("percolating doc with 2 fields");
response = client().prepareSearch()
.setQuery(new PercolateQueryBuilder("query", "test", "type", "6", null, null, null))
.setQuery(new PercolateQueryBuilder("query", "test", "6", null, null, null))
.addSort("id", SortOrder.ASC)
.get();
assertHitCount(response, 3);
Expand All @@ -449,7 +449,7 @@ public void testPercolatorQueryExistingDocumentSourceDisabled() throws Exception
logger.info("percolating empty doc with source disabled");
IllegalArgumentException e = expectThrows(
IllegalArgumentException.class,
() -> { client().prepareSearch().setQuery(new PercolateQueryBuilder("query", "test", "type", "1", null, null, null)).get(); }
() -> { client().prepareSearch().setQuery(new PercolateQueryBuilder("query", "test", "1", null, null, null)).get(); }
);
assertThat(e.getMessage(), containsString("source disabled"));
}
Expand Down Expand Up @@ -1204,10 +1204,10 @@ public void testPercolatorQueryViaMultiSearch() throws Exception {
)
)
)
.add(client().prepareSearch("test").setQuery(new PercolateQueryBuilder("query", "test", "type", "5", null, null, null)))
.add(client().prepareSearch("test").setQuery(new PercolateQueryBuilder("query", "test", "5", null, null, null)))
.add(
client().prepareSearch("test") // non existing doc, so error element
.setQuery(new PercolateQueryBuilder("query", "test", "type", "6", null, null, null))
.setQuery(new PercolateQueryBuilder("query", "test", "6", null, null, null))
)
.get();

Expand Down Expand Up @@ -1239,7 +1239,7 @@ public void testPercolatorQueryViaMultiSearch() throws Exception {
item = response.getResponses()[5];
assertThat(item.getResponse(), nullValue());
assertThat(item.getFailureMessage(), notNullValue());
assertThat(item.getFailureMessage(), containsString("[test/type/6] couldn't be found"));
assertThat(item.getFailureMessage(), containsString("[test/6] couldn't be found"));
}

public void testDisallowExpensiveQueries() throws IOException {
Expand Down
Loading