-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Only aggregations require at least one shard request #115314
Changes from all commits
3f1cc7c
69df9d6
cd134a3
a02fbc5
d9a0a54
0db1e2f
dfa33b2
5721617
36ec740
4ceff05
3d02124
d1e9ce0
2b3cbb1
ad8d4d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 115314 | ||
summary: Only aggregations require at least one shard request | ||
area: Search | ||
type: enhancement | ||
issues: [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
import org.apache.lucene.document.LongPoint; | ||
import org.apache.lucene.index.DirectoryReader; | ||
import org.apache.lucene.index.PointValues; | ||
import org.apache.lucene.search.TotalHits; | ||
import org.elasticsearch.action.search.SearchType; | ||
import org.elasticsearch.common.Strings; | ||
import org.elasticsearch.index.IndexSettings; | ||
|
@@ -206,10 +207,10 @@ public void testCanMatchCoordinator() throws Exception { | |
) | ||
.setSize(5), | ||
response -> { | ||
assertNull(response.getHits().getTotalHits()); | ||
assertEquals(new TotalHits(0, TotalHits.Relation.EQUAL_TO), response.getHits().getTotalHits()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, why was it null before? We were unskipping one shard, yet getting null total hits? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's because of SearchPhaseController#merge when we skip all the shards we have an empty result and therefore we |
||
assertEquals(0, response.getHits().getHits().length); | ||
assertEquals(5, response.getSuccessfulShards()); | ||
assertEquals(4, response.getSkippedShards()); | ||
assertEquals(5, response.getSkippedShards()); | ||
} | ||
); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting, the previous suggested we were skipping can match, that would have been a better work-around, but if your code change was required, that means that we were not skipping can match? was it outdated then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous comment was outdated, there was a refactor of this method a while back and the
setPreFilterShardSize
the comments referees to was removed