You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@solr.apache.org by Vivek Mandlik <vi...@gmail.com> on 2023/05/15 08:02:38 UTC

Request for guidance on Solr highlighting

Dear Team,

I am reaching out to seek your guidance on Solr highlighting. Currently, I
am working with Solr 8.11.2 and using the original highlighter as default.
However, I have a requirement to return the paragraph in which the
highlighted term is found.

I have gone through various sites and used different AI tools to set the
fragsize to a particular distance and snippets, but none of them matched my
requirements. As a fresher and new to Solr, I am seeking your help in
providing me with the necessary guidance.

I have a few questions that I hope you can help me with:

1. Is it possible to return the paragraph in which the searched term is
found?
2. If it is possible in Solr 8.11.2, how can I achieve it?
3. Is it possible in any other versions of Solr?

I would greatly appreciate your help in finding the answer to my question.
Your response and suggestions are warmly welcomed.

Thank you for your time and consideration.

Best regards,
Vivek Mandlik

Re: Request for guidance on Solr highlighting

Posted by Alessandro Benedetti <a....@sease.io>.
What's your definition of 'paragraph'?
If 'a distinct section of a piece of writing, usually dealing with a single
theme and indicated by a new line, indentation, or numbering.' is good
enough, then, no, Apache Solr won't do a variable sized fragment, to match
an entire paragraph.

The closest you get is through the regular expression* hl.fragmenter *from
the original highlighter:
https://solr.apache.org/guide/solr/latest/query-guide/highlighting.html#original-highlighter
and the * boundary scanner of the fast vector highlighter: *
https://solr.apache.org/guide/solr/latest/query-guide/highlighting.html#using-boundary-scanners-with-the-fastvector-highlighter

But it would definitely be useful, and cool to develop and contribute!


Cheers

--------------------------
*Alessandro Benedetti*
Director @ Sease Ltd.
*Apache Lucene/Solr Committer*
*Apache Solr PMC Member*

e-mail: a.benedetti@sease.io


*Sease* - Information Retrieval Applied
Consulting | Training | Open Source

Website: Sease.io <http://sease.io/>
LinkedIn <https://linkedin.com/company/sease-ltd> | Twitter
<https://twitter.com/seaseltd> | Youtube
<https://www.youtube.com/channel/UCDx86ZKLYNpI3gzMercM7BQ> | Github
<https://github.com/seaseltd>


On Mon, 15 May 2023 at 14:54, Vivek Mandlik <vi...@gmail.com>
wrote:

> Dear Team,
>
> I am reaching out to seek your guidance on Solr highlighting. Currently, I
> am working with Solr 8.11.2 and using the original highlighter as default.
> However, I have a requirement to return the paragraph in which the
> highlighted term is found.
>
> I have gone through various sites and used different AI tools to set the
> fragsize to a particular distance and snippets, but none of them matched my
> requirements. As a fresher and new to Solr, I am seeking your help in
> providing me with the necessary guidance.
>
> I have a few questions that I hope you can help me with:
>
> 1. Is it possible to return the paragraph in which the searched term is
> found?
> 2. If it is possible in Solr 8.11.2, how can I achieve it?
> 3. Is it possible in any other versions of Solr?
>
> I would greatly appreciate your help in finding the answer to my question.
> Your response and suggestions are warmly welcomed.
>
> Thank you for your time and consideration.
>
> Best regards,
> Vivek Mandlik
>