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 <keshav....@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....@gmail.com > -- Sincerely yours Mikhail Khludnev https://t.me/MUST_SEARCH A caveat: Cyrillic!