You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Cario, Elaine" <El...@wolterskluwer.com> on 2014/05/02 21:44:20 UTC

Can't use 2 highlighting components in the same solrconfig

Hoping someone can help me...

I'm trying to use both the PostingsHighlighter and the FastVectorHighlighter in the same solrconfig (selection driven by different request handlers), but once I define 2 search components in the config, it always picks the Postings Highlighter (even if I never reference it in any request handler).

Is this even possible to do?  (I'm using 4.7.1).

I think the culprit is some specific code in SolrCore.loadSearchComponents(), which specifically overwrites the "highlighting" component with the contents of the "postingshighlight" component - so the components map has 2 entries, but they both point to the same highlighting class (the PostingsHighlighter).

It seems pretty deliberate (it only does it for the highlighter!), but wondering if there is some reason to allow only one version of the highlighter to be used.

We're using 2 highlighters since the FVH is slow when creating snippets for a search result list (10-50 documents), so we turned to the PH (which is definitely faster, even though it doesn't keep phrases together, but that's a post for another day).  But we like FVH for highlighting query terms in the full document, once the user clicks on a result.  The plan is to use the PH in a search request handler, and the FVH in a document view request handler.

Thanks.