Skip to content

Commit

Permalink
Size docIdsToLoad appropriately in SearchService
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Elliot authored and martijnvg committed Nov 18, 2013
1 parent 6b94a43 commit 05367fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/elasticsearch/search/SearchService.java
Expand Up @@ -590,7 +590,7 @@ private void shortcutDocIdsToLoad(SearchContext context) {
return;
}
int totalSize = context.from() + context.size();
int[] docIdsToLoad = new int[context.size()];
int[] docIdsToLoad = new int[Math.min(topDocs.scoreDocs.length - context.from(), context.size())];
int counter = 0;
for (int i = context.from(); i < totalSize; i++) {
if (i < topDocs.scoreDocs.length) {
Expand Down

0 comments on commit 05367fa

Please sign in to comment.