mirror of https://github.com/apache/lucene.git
SOLR-10722: UH optimize for Solr's getFieldInfos
This commit is contained in:
parent
622e527cf2
commit
29de0f75e8
|
@ -352,6 +352,8 @@ Optimizations
|
|||
so that the second phase which would normally involve calculating the domain for the bucket
|
||||
can be skipped entirely, leading to large performance improvements. (yonik)
|
||||
|
||||
* SOLR-10722: Speed up Solr's use of the UnifiedHighlighter be re-using FieldInfos. (David Smiley)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Set;
|
|||
import java.util.function.Predicate;
|
||||
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.FieldInfo;
|
||||
import org.apache.lucene.search.DocIdSetIterator;
|
||||
import org.apache.lucene.search.Query;
|
||||
import org.apache.lucene.search.uhighlight.CustomSeparatorBreakIterator;
|
||||
|
@ -263,6 +264,12 @@ public class UnifiedSolrHighlighter extends SolrHighlighter implements PluginInf
|
|||
}
|
||||
}
|
||||
|
||||
// optimization for Solr which keeps a FieldInfos on-hand
|
||||
@Override
|
||||
protected FieldInfo getFieldInfo(String field) {
|
||||
return ((SolrIndexSearcher)searcher).getFieldInfos().fieldInfo(field);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxNoHighlightPassages(String field) {
|
||||
boolean defaultSummary = params.getFieldBool(field, HighlightParams.DEFAULT_SUMMARY, false);
|
||||
|
|
Loading…
Reference in New Issue