lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Chang <jclal...@gmail.com>
Subject Re: highlighting in multiValued field
Date Fri, 27 May 2011 04:15:42 GMT
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

On Fri, May 27, 2011 at 11:33 AM, Bob Sandiford <
bob.sandiford@sirsidynix.com> wrote:

> What is your actual query?  Did you look at the "hl.snippets" parameter?
>
> Bob Sandiford | Lead Software Engineer | SirsiDynix
> P: 800.288.8020 X6943 | Bob.Sandiford@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:jclalala@gmail.com]
> > Sent: Thursday, May 26, 2011 11:10 PM
> > To: solr-user@lucene.apache.org
> > Subject: highlighting in multiValued field
> >
> > Hi All,
> >
> > I am having a problem with search highlighting for multiValued fields
> > and am
> > wondering if someone can point me in the right direction.
> >
> > I have in my schema a multiValued field as such:
> >  <field name="description" type="text" stored="true" indexed="true"
> > multiValued="true"/>
> >
> > When I search for term "Tel", it returns me the correct doc:
> > <doc>
> > ...
> > <arr name="description">
> >   <str>Tel to talent 1</str>
> >   <str>Tel to talent 2</str>
> >   </arr>
> > ...
> > </doc>
> >
> > When I enable highlighting, it returns me the following highlight with
> > only
> > one vector returned:
> > ...
> > <lst name="highlighting">
> >   <lst name="1">
> >   <arr name="description">
> >     <str><em>Tel</em> to talent 1</str>
> >   </arr>
> >   </lst>
> > </lst>
> > What I'm expecting is actually both vectors to be returned as such:
> > <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>
> > </lst>
> > Am I doing something wrong in my config or query (I'm using default)?
> > Any
> > help is appreciated.
> >
> > Thanks,
> > Jeff
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message