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 "Van Tassell, Kristian" <kr...@siemens.com> on 2013/03/15 20:08:35 UTC

Confusion over Solr highlight hl.q parameter

Hello everyone,

If I search for a term “baz” and tell it to highlight it, it highlights just fine.

If, however, I search for “foo bar” using the q parameter, which appears in that same document/same field, and use the hl.q parameter to search and highlight “baz”, I get no highlighting results for “baz”.

?q=パーツにおける機能強化
&qf=text_ja_JP
&defType=edismax
&hl=true
&hl.simple.pre=<em>
&hl.simple.post=</em>
&hl.fl=text_ja_JP

The above highlights query term just fine.

?q=1234
&hl.q=パーツにおける機能強化
&qf=id
&defType=edismax
&hl=true
&hl.simple.pre=<em>
&hl.simple.post=</em>
&hl.fl=text_ja_JP

This one returns zero highlighting hits.


RE: Confusion over Solr highlight hl.q parameter

Posted by "Van Tassell, Kristian" <kr...@siemens.com>.
Thank you for the response, unfortunately it didn't change that I'm still getting no highlighting hits for this query. 

...hl.q={!dismax}text_it_IT:l'assieme...

-----Original Message-----
From: Koji Sekiguchi [mailto:koji@r.email.ne.jp] 
Sent: Tuesday, April 02, 2013 9:00 PM
To: solr-user@lucene.apache.org
Subject: Re: Confusion over Solr highlight hl.q parameter

(13/04/03 5:27), Van Tassell, Kristian wrote:
> Thanks Koji, this helped with some of our problems, but it is still not perfect.
> 
> This query, for example, returns no highlighting:
> 
> ?q=id:abc123&hl.q=text_it_IT:l'assieme&hl.fl=text_it_IT&hl=true&defTyp
> e=edismax
> 
> But this one does (when it is, in effect, the same query):
> 
> ?q=text_it_IT:l'assieme&hl=true&defType=edismax&hl.fl=text_it_IT
> 
> I've tried many combinations but can't seem to get the right one to work. Is this possibly a bug?

As hl.q doesn't care defType parameter but does localParams, can you try to put {!edismax} to hl.q parameter?

koji
--
http://soleami.com/blog/lucene-4-is-super-convenient-for-developing-nlp-tools.html

Re: Confusion over Solr highlight hl.q parameter

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
(13/04/03 5:27), Van Tassell, Kristian wrote:
> Thanks Koji, this helped with some of our problems, but it is still not perfect.
> 
> This query, for example, returns no highlighting:
> 
> ?q=id:abc123&hl.q=text_it_IT:l'assieme&hl.fl=text_it_IT&hl=true&defType=edismax
> 
> But this one does (when it is, in effect, the same query):
> 
> ?q=text_it_IT:l'assieme&hl=true&defType=edismax&hl.fl=text_it_IT
> 
> I've tried many combinations but can't seem to get the right one to work. Is this possibly a bug?

As hl.q doesn't care defType parameter but does localParams,
can you try to put {!edismax} to hl.q parameter?

koji
-- 
http://soleami.com/blog/lucene-4-is-super-convenient-for-developing-nlp-tools.html

RE: Confusion over Solr highlight hl.q parameter

Posted by "Van Tassell, Kristian" <kr...@siemens.com>.
Thanks Koji, this helped with some of our problems, but it is still not perfect.

This query, for example, returns no highlighting:

?q=id:abc123&hl.q=text_it_IT:l'assieme&hl.fl=text_it_IT&hl=true&defType=edismax

But this one does (when it is, in effect, the same query):

?q=text_it_IT:l'assieme&hl=true&defType=edismax&hl.fl=text_it_IT

I've tried many combinations but can't seem to get the right one to work. Is this possibly a bug? 

-----Original Message-----
From: Koji Sekiguchi [mailto:koji@r.email.ne.jp] 
Sent: Saturday, March 16, 2013 6:14 PM
To: solr-user@lucene.apache.org
Subject: Re: Confusion over Solr highlight hl.q parameter

(13/03/16 4:08), Van Tassell, Kristian wrote:
> Hello everyone,
> 
> If I search for a term “baz” and tell it to highlight it, it highlights just fine.
> 
> If, however, I search for “foo bar” using the q parameter, which appears in that same document/same field, and use the hl.q parameter to search and highlight “baz”, I get no highlighting results for “baz”.
> 
> ?q=パーツにおける機能強化
> &qf=text_ja_JP
> &defType=edismax
> &hl=true
> &hl.simple.pre=<em>
> &hl.simple.post=</em>
> &hl.fl=text_ja_JP
> 
> The above highlights query term just fine.
> 
> ?q=1234
> &hl.q=パーツにおける機能強化
> &qf=id
> &defType=edismax
> &hl=true
> &hl.simple.pre=<em>
> &hl.simple.post=</em>
> &hl.fl=text_ja_JP
> 
> This one returns zero highlighting hits.

I'm just guessing, Solr highlighter tries to highlight "パーツにおける機能強化" in your default search field? Can you try hl.q=text_ja_JP:パーツにおける機能強化 .

koji
--
http://soleami.com/blog/lucene-4-is-super-convenient-for-developing-nlp-tools.html

Re: Confusion over Solr highlight hl.q parameter

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
(13/03/16 4:08), Van Tassell, Kristian wrote:
> Hello everyone,
> 
> If I search for a term “baz” and tell it to highlight it, it highlights just fine.
> 
> If, however, I search for “foo bar” using the q parameter, which appears in that same document/same field, and use the hl.q parameter to search and highlight “baz”, I get no highlighting results for “baz”.
> 
> ?q=パーツにおける機能強化
> &qf=text_ja_JP
> &defType=edismax
> &hl=true
> &hl.simple.pre=<em>
> &hl.simple.post=</em>
> &hl.fl=text_ja_JP
> 
> The above highlights query term just fine.
> 
> ?q=1234
> &hl.q=パーツにおける機能強化
> &qf=id
> &defType=edismax
> &hl=true
> &hl.simple.pre=<em>
> &hl.simple.post=</em>
> &hl.fl=text_ja_JP
> 
> This one returns zero highlighting hits.

I'm just guessing, Solr highlighter tries to highlight "パーツにおける機能強化" in your
default search field? Can you try hl.q=text_ja_JP:パーツにおける機能強化 .

koji
-- 
http://soleami.com/blog/lucene-4-is-super-convenient-for-developing-nlp-tools.html