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*
work.

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

Best
Erick

On Wed, Nov 2, 2011 at 5:44 PM, solrdude <yog...@searchreviews.com> 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: 
> http://lucene.472066.n3.nabble.com/Highlighting-text-field-when-query-is-for-string-field-tp3475334p3475334.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to