[
https://issues.apache.org/jira/browse/SOLR-7655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14579476#comment-14579476
]
David Smiley commented on SOLR-7655:
------------------------------------
Suggested fix:
{code:java}
try {
scorer.setUsePayloads(request.getParams().getFieldBool(fieldName,
HighlightParams.PAYLOADS,
request.getSearcher().getLeafReader().fields().terms(fieldName).hasPayloads()));
// It'd be nice to know if payloads are on the tokenStream but the
presence of the attribute isn't a good
// indicator.
} catch (IOException e) {
throw new RuntimeException(e);
}
{code}
I'm going to try this now with Solr's tests, then post a patch.
> Perf bug- DefaultSolrHighlighter.getSpanQueryScorer triggers
> MultiFields.getMergedFieldInfos
> --------------------------------------------------------------------------------------------
>
> Key: SOLR-7655
> URL: https://issues.apache.org/jira/browse/SOLR-7655
> Project: Solr
> Issue Type: Bug
> Components: highlighter
> Affects Versions: 5.0
> Reporter: David Smiley
> Assignee: David Smiley
>
> It appears grabbing the FieldInfos from the SlowCompositeReaderWrapper is
> slow. It isn't cached. The DefaultSolrHighligher in SOLR-6196 (v5.0) uses
> it to ascertain if there are payloads. Instead it can grab it from the Terms
> instance, which is cached.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]