Don't use official searcher for production queries
This commit is contained in:
parent
3cdafd748e
commit
5157656a2c
@ -16,7 +16,7 @@ public class AdaptiveLocalSearcher implements LocalSearcher {
|
|||||||
|
|
||||||
private static final OfficialSearcher officialSearcher = new OfficialSearcher();
|
private static final OfficialSearcher officialSearcher = new OfficialSearcher();
|
||||||
|
|
||||||
private static final LocalSearcher localPagedSearcher = new PagedLocalSearcher();
|
private static final LocalSearcher scoredPaged = new PagedLocalSearcher();
|
||||||
|
|
||||||
private static final LocalSearcher countSearcher = new CountMultiSearcher();
|
private static final LocalSearcher countSearcher = new CountMultiSearcher();
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public class AdaptiveLocalSearcher implements LocalSearcher {
|
|||||||
return countSearcher.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
return countSearcher.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
||||||
} else if (queryParams.isSorted() || queryParams.needsScores()) {
|
} else if (queryParams.isSorted() || queryParams.needsScores()) {
|
||||||
if (realLimit <= maxAllowedInMemoryLimit) {
|
if (realLimit <= maxAllowedInMemoryLimit) {
|
||||||
return localPagedSearcher.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
return scoredPaged.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
||||||
} else {
|
} else {
|
||||||
if ((queryParams.isSorted() && !queryParams.isSortedByScore())) {
|
if ((queryParams.isSorted() && !queryParams.isSortedByScore())) {
|
||||||
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
||||||
@ -81,7 +81,7 @@ public class AdaptiveLocalSearcher implements LocalSearcher {
|
|||||||
if (sortedScoredFull != null) {
|
if (sortedScoredFull != null) {
|
||||||
return sortedScoredFull.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
return sortedScoredFull.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
||||||
} else {
|
} else {
|
||||||
return officialSearcher.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
return scoredPaged.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
||||||
@ -90,7 +90,7 @@ public class AdaptiveLocalSearcher implements LocalSearcher {
|
|||||||
if (unsortedScoredFull != null) {
|
if (unsortedScoredFull != null) {
|
||||||
return unsortedScoredFull.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
return unsortedScoredFull.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
||||||
} else {
|
} else {
|
||||||
return officialSearcher.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
return scoredPaged.collect(indexSearcher, queryParams, keyFieldName, transformer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class AdaptiveMultiSearcher implements MultiSearcher {
|
|||||||
if (sortedScoredFull != null) {
|
if (sortedScoredFull != null) {
|
||||||
return sortedScoredFull.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
return sortedScoredFull.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
||||||
} else {
|
} else {
|
||||||
return officialSearcher.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
return scoredPaged.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
if (queryParams.limitLong() < MAX_IN_MEMORY_SIZE) {
|
||||||
@ -78,7 +78,7 @@ public class AdaptiveMultiSearcher implements MultiSearcher {
|
|||||||
if (unsortedScoredFull != null) {
|
if (unsortedScoredFull != null) {
|
||||||
return unsortedScoredFull.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
return unsortedScoredFull.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
||||||
} else {
|
} else {
|
||||||
return officialSearcher.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
return scoredPaged.collectMulti(indexSearchersMono, queryParams, keyFieldName, transformer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user