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:k...@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

Reply via email to