Hi Edwin,

you are limiting the portion of the document analyzed for highlighting in your 
solrconfig.xml by

 <str name="hl.maxAnalyzedChars">1000000</str>

Thus, snippets are only produced correctly if the query was found in the first 
1000000 characters of the document.

If you set this parameter to

 <str name="hl.maxAnalyzedChars">-1</str>

the original highlighter uses the whole document to find the snippet.

I hope that helps
  Jens


> Am 04.12.2015 um 16:51 schrieb Zheng Lin Edwin Yeo <edwinye...@gmail.com>:
> 
> Hi,
> 
> I'm using Solr 5.3.0
> 
> I found that in large documents, sometimes I face situation that when I do
> a highlight query, the resultset that is returned does not contain the
> highlighted query. There are actually matches in the documents, but just
> that they located further back in the documents.
> 
> I have tried to increase the value of the hl.maxAnalyzedChars, as the
> default value is 51200, and I have documents that are much larger than
> 51200 characters. Although this method works, but, when I increase this
> value, the performance of the search and highlight drops. It can drop from
> less than 0.5 seconds to more than 10 seconds.
> 
> Would like to check, is this method of increasing the value of the
> hl.maxAnalyzedChars the best method to use, or is there other ways which
> can solve the same purpose, but without affecting the performance much?
> 
> Regards,
> Edwin

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to