lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: Highlighting "text" field when query is for "string" field
Date Fri, 04 Nov 2011 15:33:39 GMT
Try this with &debugQuery=on. I suspect you're not getting the query you
think you are and I'd straighten that out before worrying about highlighting.

Usually, for instance, AND should be capitalized to be an operator.

So try with &debugQuery=on and see what happens. The highlighter, I
believe, will try to highlight on all returned fields by default so it *should*

And I assume you're setting 'stored="true" ' on your excerpt field?


On Wed, Nov 2, 2011 at 5:44 PM, solrdude <> wrote:
> I have situation where I need to highlight matching phrases in "text" field
> where as query is against "string" field. Its not highlighting now, may be
> because in text field they are all terms and hence not a match for phrase.
> How do i do it? With hl.alternateField, it identifies those things in
> <highlighting> field, but not applying default <em> around matching phrase.
> How do I get it to mark it?
> Eg:
> <doc>
> <str name="keyword_text">smooth skin</str>  // field type: string
> <str name="excerpt">Smooth skin</str>    // field type: text
> </doc>
> query:
> http://localhost:8080/mycore/select?facet=true&group.ngroups=true&facet.mincount=1&group.limit=3&facet.limit=10&hl=true&rows=10&version=2&start=0&q=keyword:%22smooth+skin%22+and+publishStatus:Live&group.field=productName&group=true&facet.field=brand&hl.fl=excerpt&hl.alternateField=excerpt
> Thanks
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

View raw message