Hi All,

I'll share my own workaround for my own issue.

I simply created a new multiValued field that concatenantes the multiValued
fields for index. During search, I will then have both fields in the same
array position.

Thanks,
Jeff

On Fri, May 27, 2011 at 10:24 PM, Jeffrey Chang <jclal...@gmail.com> wrote:

> Hi Bob,
>
> Hmm... I don't think this approach will scale with bigger and more
> documents :(
>
> Thanks for your help though; I think I should take a look at customizing
> highlight component to achieve this...
>
> Thanks,
> Jeff
>
>
>
> On May 27, 2011, at 12:24 PM, Bob Sandiford <bob.sandif...@sirsidynix.com>
> wrote:
>
> > The only thing I can think of is to post-process your snippets.  I.E.
> pull the highlighting tags out of the strings, look for the match in your
> result "description" field looking for a match, and if you find one, replace
> that "description" with the original highlight text (i.e. with the highlight
> tags still in place).
> >
> > Bob Sandiford | Lead Software Engineer | SirsiDynix
> > P: 800.288.8020 X6943 | bob.sandif...@sirsidynix.com
> > www.sirsidynix.com
> > Join the conversation - you may even get an iPad or Nook out of it!
> >
> > Like us on Facebook!
> >
> > Follow us on Twitter!
> >
> >
> >
> >> -----Original Message-----
> >> From: Jeffrey Chang [mailto:jclal...@gmail.com]
> >> Sent: Friday, May 27, 2011 12:16 AM
> >> To: solr-user@lucene.apache.org
> >> Subject: Re: highlighting in multiValued field
> >>
> >> Hi Bob,
> >>
> >> I have no idea how I missed that! Thanks for pointing me to use
> >> hl.snippets
> >> - that did the magic!
> >>
> >> Please allow me squeeze one more question along the same line.
> >>
> >> Since I'm now able to display multiple snippets - what I'm trying to
> >> achieve
> >> is, determine which highlighted snippet maps back to what position in
> >> the
> >> original document.
> >>
> >> e.g. If I search for "Tel", with highlighting and hl.snippets=2 it'll
> >> return
> >> me:
> >> <doc>
> >> ...
> >> <arr name="descID">
> >>  <str>1</str>
> >>  <str>2</str>
> >>  <str>3</str>
> >> </arr>
> >> <arr name="description">
> >>  <str>Tel to talent 1</str>
> >>  <str>Tel to talent 2</str>
> >>  <str>Tel to talent 3</str>
> >> </arr>
> >> ...
> >> </doc>
> >> <lst name="highlighting">
> >>  <lst name="1">
> >>  <arr name="description">
> >>    <str><em>Tel</em> to talent 1</str>
> >>    <str><em>Tel</em> to talent 2</str>
> >>  </arr>
> >> </lst>
> >> ...
> >>
> >> Is there a way for me to figure out which highlighted snippet belongs
> >> to
> >> which descID so I can display also display the non-highlighted rows for
> >> my
> >> search results.
> >>
> >> Or is this not the way how highlighting is designed and to be used?
> >>
> >> Thanks so much,
> >> Jeff
> >> [snip]
> >
>

Reply via email to