lucene-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucene-solr] romseygeek commented on a change in pull request #1011: LUCENE-9031: Just highlight term intervals and its' combinations.
Date Sat, 16 Nov 2019 16:42:56 GMT
romseygeek commented on a change in pull request #1011: LUCENE-9031: Just highlight term intervals
and its' combinations.
URL: https://github.com/apache/lucene-solr/pull/1011#discussion_r347098267
 
 

 ##########
 File path: lucene/queries/src/java/org/apache/lucene/queries/intervals/TermIntervalsSource.java
 ##########
 @@ -149,10 +150,18 @@ public MatchesIterator matches(String field, LeafReaderContext ctx,
int doc) thr
     if (te.seekExact(term) == false) {
       return null;
     }
-    return matches(te, doc);
+    final TermQuery query;
+    final TermQuery cached = matchingQuery;
+    if (cached==null || !field.equals(cached.getTerm().field())) {
+      matchingQuery = query = new TermQuery(new Term(field, term));
+    } else {
+      query = cached;
+    }
+    return matches(te, doc, field);
   }
 
-  static MatchesIterator matches(TermsEnum te, int doc) throws IOException {
+  static MatchesIterator matches(TermsEnum te, int doc, String field) throws IOException
{
+      TermQuery query = new TermQuery(new Term(field, te.term()));
 
 Review comment:
   nit: spacing

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Mime
View raw message