You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ahmed Boubaker <ab...@gmail.com> on 2011/08/05 18:42:55 UTC

highlight on prefix query

Hi,

I am using solr 3 and highlighting is working fine.  However when using
prefix query like tel*, the highlighter highlights the whole matching words
(i.e. television, telephone, ...).  I am highlighting a very short field
(3~5 words length).

How can I prevent the highlighter from doing so?  I want to get only the
prefix of these words highlighted (i.e. <em>tel</em>evision,
<em>tel</em>ephone, ...), any solution or idea ?

Many thanks for your help,

Boubaker

Re: highlight on prefix query

Posted by Ahmed Boubaker <ab...@gmail.com>.
Well, that's one use case, there're others where you need to highlight only
what is matching.

For now, I solved the problem by writing an additional procedure to correct
the highlighting.  Not nice, but it works!

On Sat, Aug 6, 2011 at 11:10 AM, Kissue Kissue <ki...@gmail.com> wrote:

> I think this is correct behaviour. If you go to google and search for
> "Tel",
> you will see that telephone is highlighted.
>
> On Fri, Aug 5, 2011 at 5:42 PM, Ahmed Boubaker
> <ab...@gmail.com>wrote:
>
> > Hi,
> >
> > I am using solr 3 and highlighting is working fine.  However when using
> > prefix query like tel*, the highlighter highlights the whole matching
> words
> > (i.e. television, telephone, ...).  I am highlighting a very short field
> > (3~5 words length).
> >
> > How can I prevent the highlighter from doing so?  I want to get only the
> > prefix of these words highlighted (i.e. <em>tel</em>evision,
> > <em>tel</em>ephone, ...), any solution or idea ?
> >
> > Many thanks for your help,
> >
> > Boubaker
> >
>

Re: highlight on prefix query

Posted by Kissue Kissue <ki...@gmail.com>.
I think this is correct behaviour. If you go to google and search for "Tel",
you will see that telephone is highlighted.

On Fri, Aug 5, 2011 at 5:42 PM, Ahmed Boubaker
<ab...@gmail.com>wrote:

> Hi,
>
> I am using solr 3 and highlighting is working fine.  However when using
> prefix query like tel*, the highlighter highlights the whole matching words
> (i.e. television, telephone, ...).  I am highlighting a very short field
> (3~5 words length).
>
> How can I prevent the highlighter from doing so?  I want to get only the
> prefix of these words highlighted (i.e. <em>tel</em>evision,
> <em>tel</em>ephone, ...), any solution or idea ?
>
> Many thanks for your help,
>
> Boubaker
>