Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a way to get a text summary of an indexed document with CLucene (a.k.a. a “snippet” or “fragment”) to display along with the search result?

0
Posted

Is there a way to get a text summary of an indexed document with CLucene (a.k.a. a “snippet” or “fragment”) to display along with the search result?

0

You need to store the documents’ summary in the index (use ”Field Store” when creating that field) and then use the Highlighter from the contrib package. It’s important to use a rewritten query as the input for the highlighter, i.e. call rewrite() on the query. Otherwise simple queries will work but prefix queries etc will not be highlighted.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123