You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ge...@apache.org on 2020/01/08 19:41:06 UTC
[lucene-solr] branch jira/solr-13890 updated: SOLR-13890: Address
review comments, round 2b
This is an automated email from the ASF dual-hosted git repository.
gerlowskija pushed a commit to branch jira/solr-13890
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/jira/solr-13890 by this push:
new a88e559 SOLR-13890: Address review comments, round 2b
a88e559 is described below
commit a88e559f4f66fae5b02f73200dc359ee747216e9
Author: Jason Gerlowski <ge...@apache.org>
AuthorDate: Wed Jan 8 14:40:38 2020 -0500
SOLR-13890: Address review comments, round 2b
Missed the removal of the unnecessary ExtendedQuery methods
---
.../org/apache/solr/search/TermsQParserPlugin.java | 27 ++++------------------
1 file changed, 5 insertions(+), 22 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java
index e21d356..95fe014 100644
--- a/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java
+++ b/solr/core/src/java/org/apache/solr/search/TermsQParserPlugin.java
@@ -159,14 +159,11 @@ public class TermsQParserPlugin extends QParserPlugin {
};
}
- private static class TopLevelDocValuesTermsQuery extends DocValuesTermsQuery implements ExtendedQuery{
+ private static class TopLevelDocValuesTermsQuery extends DocValuesTermsQuery {
private final String fieldName;
private SortedSetDocValues topLevelDocValues;
private LongBitSet topLevelTermOrdinals;
private boolean matchesAtLeastOneTerm = false;
- private boolean cache = true;
- private boolean cacheSeparately = false;
- private int cost;
public TopLevelDocValuesTermsQuery(String field, BytesRef... terms) {
@@ -196,6 +193,10 @@ public class TermsQParserPlugin extends QParserPlugin {
return new ConstantScoreWeight(this, boost) {
public Scorer scorer(LeafReaderContext context) throws IOException {
+ if (! matchesAtLeastOneTerm) {
+ return null;
+ }
+
SortedSetDocValues segmentDocValues = context.reader().getSortedSetDocValues(fieldName);
if (segmentDocValues == null) {
return null;
@@ -227,24 +228,6 @@ public class TermsQParserPlugin extends QParserPlugin {
};
}
- @Override
- public void setCache(boolean cache) { this.cache = cache; }
-
- @Override
- public boolean getCache() { return cache; }
-
- @Override
- public int getCost() { return cost; }
-
- @Override
- public void setCost(int cost) { this.cost = cost; }
-
- @Override
- public boolean getCacheSep() { return cacheSeparately; }
-
- @Override
- public void setCacheSep(boolean cacheSep) { this.cacheSeparately = cacheSep; }
-
/*
* Same binary-search based implementation as SortedSetDocValues.lookupTerm(BytesRef), but with an
* optimization to narrow the search space where possible by providing a startOrd instead of begining each search