mirror of https://github.com/apache/lucene.git
LUCENE-5222: fix expression sort with executorService
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1524575 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ced67903ad
commit
4d53022c49
|
@ -205,7 +205,7 @@ public class Sort {
|
|||
/** Whether the relevance score is needed to sort documents. */
|
||||
boolean needsScores() {
|
||||
for (SortField sortField : fields) {
|
||||
if (sortField.getType() == SortField.Type.SCORE) {
|
||||
if (sortField.needsScores()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -402,4 +402,9 @@ public class SortField {
|
|||
public SortField rewrite(IndexSearcher searcher) throws IOException {
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Whether the relevance score is needed to sort documents. */
|
||||
public boolean needsScores() {
|
||||
return type == Type.SCORE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,4 +35,9 @@ class ExpressionSortField extends SortField {
|
|||
public FieldComparator<?> getComparator(final int numHits, final int sortPos) throws IOException {
|
||||
return new ExpressionComparator(source, numHits);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsScores() {
|
||||
return true; // TODO: maybe we can optimize by "figuring this out" somehow...
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue