romseygeek commented on issue #15668:
URL: https://github.com/apache/lucene/issues/15668#issuecomment-3859990103

   I had a quick look, and I think a change to `WeightedSpanTermExtractor` that 
looks something like this should work:
   ```
   diff --git 
a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
 
b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
   index 1370afd736b..a16fff06467 100644
   --- 
a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
   +++ 
b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
   @@ -27,6 +27,7 @@ import java.util.Set;
    import org.apache.lucene.analysis.CachingTokenFilter;
    import org.apache.lucene.analysis.TokenStream;
    import org.apache.lucene.index.BinaryDocValues;
   +import org.apache.lucene.index.FieldInfo;
    import org.apache.lucene.index.FieldInfos;
    import org.apache.lucene.index.FilterLeafReader;
    import org.apache.lucene.index.IndexReader;
   @@ -444,7 +445,12 @@ public class WeightedSpanTermExtractor {
   
        @Override
        public FieldInfos getFieldInfos() {
   -      throw new UnsupportedOperationException(); // TODO merge them
   +      return new FieldInfos(new FieldInfo[]{ 
super.getFieldInfos().fieldInfo(DelegatingLeafReader.FIELD_NAME) }) {
   +        @Override
   +        public FieldInfo fieldInfo(String fieldName) {
   +          return super.fieldInfo(DelegatingLeafReader.FIELD_NAME);
   +        }
   +      };
        }
   
        @Override
   ```
   
   Feel free to take this and run with it @sjs004 :) 


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to