highlighting marks wrong words

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

highlighting marks wrong words

Alexey Shakov
Hi all,

I have a query like this:

q=(auto) AND id:(100 OR 1 OR 2 OR 3 OR 5 OR
6)&fl=score&hl.fl=content&hl=true&hl.fragsize=200&hl.snippets=2&hl.simple.pre=%3Cb%3E&hl.simple.post=%3C%2Fb%3E&start=0&rows=10

Default field is content.

So, I expect, that only occurrencies of "auto" will be marked.

BUT: the occurrencies of id (100, 1, 2, ..), which occasionally also
present in content field, are marked as well...

The result looks like:

North American International <b>Auto</b> Show 2007 - Celebrating
<b>100</b> years


Any ideas?

Thanx in advance!


Reply | Threaded
Open this post in threaded view
|

RE: highlighting marks wrong words

Charlie Jackson
I believe changing the "AND id: etc etc " part of the query to it's on
filter query will take care of your highlighting problem.

In other words, try a query like this:

q=(auto)&fq=id:(100 OR 1 OR 2 OR 3 OR 5 OR
6)&fl=score&hl.fl=content&hl=true&hl.fragsize=200&hl.snippets=2&hl.simpl
e.pre=%3Cb%3E&hl.simple.post=%3C%2Fb%3E&start=0&rows=10

This could also get you a performance boost if you're querying against
this set of ids often.

-----Original Message-----
From: Alexey Shakov [mailto:[hidden email]]
Sent: Tuesday, January 15, 2008 6:54 AM
To: [hidden email]
Subject: highlighting marks wrong words

Hi all,

I have a query like this:

q=(auto) AND id:(100 OR 1 OR 2 OR 3 OR 5 OR
6)&fl=score&hl.fl=content&hl=true&hl.fragsize=200&hl.snippets=2&hl.simpl
e.pre=%3Cb%3E&hl.simple.post=%3C%2Fb%3E&start=0&rows=10

Default field is content.

So, I expect, that only occurrencies of "auto" will be marked.

BUT: the occurrencies of id (100, 1, 2, ..), which occasionally also
present in content field, are marked as well...

The result looks like:

North American International <b>Auto</b> Show 2007 - Celebrating
<b>100</b> years


Any ideas?

Thanx in advance!


Reply | Threaded
Open this post in threaded view
|

Re: highlighting marks wrong words

Alexey Shakov
Thank you! It works correct with filter query

Charlie Jackson schrieb:

>  I believe changing the "AND id: etc etc " part of the query to it's on
>  filter query will take care of your highlighting problem.
>
>  In other words, try a query like this:
>
>  q=(auto)&fq=id:(100 OR 1 OR 2 OR 3 OR 5 OR
>  6)&fl=score&hl.fl=content&hl=true&hl.fragsize=200&hl.snippets=2&hl.simpl
>  e.pre=%3Cb%3E&hl.simple.post=%3C%2Fb%3E&start=0&rows=10
>
>  This could also get you a performance boost if you're querying against
>  this set of ids often.
>
>  -----Original Message-----
>  From: Alexey Shakov [mailto:[hidden email]]
>  Sent: Tuesday, January 15, 2008 6:54 AM
>  To: [hidden email]
>  Subject: highlighting marks wrong words
>
>  Hi all,
>
>  I have a query like this:
>
>  q=(auto) AND id:(100 OR 1 OR 2 OR 3 OR 5 OR
>  6)&fl=score&hl.fl=content&hl=true&hl.fragsize=200&hl.snippets=2&hl.simpl
>  e.pre=%3Cb%3E&hl.simple.post=%3C%2Fb%3E&start=0&rows=10
>
>  Default field is content.
>
>  So, I expect, that only occurrencies of "auto" will be marked.
>
>  BUT: the occurrencies of id (100, 1, 2, ..), which occasionally also
>  present in content field, are marked as well...
>
>  The result looks like:
>
>  North American International <b>Auto</b> Show 2007 - Celebrating
>  <b>100</b> years
>
>
>  Any ideas?
>
>  Thanx in advance!
>
>