fix optimization to not do sorting when searching with score "desc" sorting

This commit is contained in:
kimchy 2010-07-17 19:38:04 +03:00
parent 7d29896190
commit 910ad2a408
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ public class QueryPhase implements SearchPhase {
boolean sort = false;
// try and optimize for a case where the sorting is based on score, this is how we work by default!
if (searchContext.sort() != null) {
if (searchContext.sort().getSort().length > 0) {
if (searchContext.sort().getSort().length > 1) {
sort = true;
} else {
SortField sortField = searchContext.sort().getSort()[0];