mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-02 08:59:09 +00:00
Core: apply 'from' if there is one shard result.
This commit is contained in:
parent
b8366a3213
commit
01ca8491cf
@ -177,9 +177,13 @@ public class SearchPhaseController extends AbstractComponent {
|
|||||||
return EMPTY_DOCS;
|
return EMPTY_DOCS;
|
||||||
}
|
}
|
||||||
int resultDocsSize = scoreDocs.length < result.size() ? scoreDocs.length : result.size();
|
int resultDocsSize = scoreDocs.length < result.size() ? scoreDocs.length : result.size();
|
||||||
|
int offset = result.from();
|
||||||
|
if (scrollSort) {
|
||||||
|
offset = 0;
|
||||||
|
}
|
||||||
ScoreDoc[] docs = new ScoreDoc[resultDocsSize];
|
ScoreDoc[] docs = new ScoreDoc[resultDocsSize];
|
||||||
for (int i = 0; i < resultDocsSize; i++) {
|
for (int i = 0; i < resultDocsSize; i++) {
|
||||||
ScoreDoc scoreDoc = scoreDocs[i];
|
ScoreDoc scoreDoc = scoreDocs[offset + i];
|
||||||
scoreDoc.shardIndex = shardIndex;
|
scoreDoc.shardIndex = shardIndex;
|
||||||
docs[i] = scoreDoc;
|
docs[i] = scoreDoc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user