You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Keshav Melnad <ke...@gmail.com> on 2023/03/17 23:00:37 UTC

Partial highlighting problem in Solr

Hi,

I have created a Solr index using whitespace index analyzer with ngram
filter and whitespace query analyzer. I am getting expected results.
However, I want to highlight partial matches, i.e., when the query is
"miss", I am expecting "sub<mark>miss</mark>ion" instead I am getting
"<mark>submission</mark>". What am I supposed to do? Should I use regex
fragmenter or use edismax defType or any other suitable idea?

Early response is highly appreciated.

With regards

*Keshav Melnad*
A5-201, Karma Residence, Sheikh Zayed City
6th of October, Giza, Egypt
Mob: +20 1555125477
Email: keshav.s.m@gmail.com

Re: Partial highlighting problem in Solr

Posted by Mikhail Khludnev <mk...@apache.org>.
I might be wrong, but my understanding is:
Token filters don't change offsets, but only a tokenizer can change
offsets that's expected in highlighting.
So, it seems like  NGramTokenizerFactory is an answer, however it doesn't
allow to tokenize by whitespace or combine it with a whitespace tokenizer.
Is there a better answer?

On Sat, Mar 18, 2023 at 2:02 AM Keshav Melnad <ke...@gmail.com> wrote:

> Hi,
>
> I have created a Solr index using whitespace index analyzer with ngram
> filter and whitespace query analyzer. I am getting expected results.
> However, I want to highlight partial matches, i.e., when the query is
> "miss", I am expecting "sub<mark>miss</mark>ion" instead I am getting
> "<mark>submission</mark>". What am I supposed to do? Should I use regex
> fragmenter or use edismax defType or any other suitable idea?
>
> Early response is highly appreciated.
>
> With regards
>
> *Keshav Melnad*
> A5-201, Karma Residence, Sheikh Zayed City
> 6th of October, Giza, Egypt
> Mob: +20 1555125477
> Email: keshav.s.m@gmail.com
>


-- 
Sincerely yours
Mikhail Khludnev
https://t.me/MUST_SEARCH
A caveat: Cyrillic!