Re: highlighting in multiValued field

2011-05-28 Thread Jeffrey Chang
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
   str1/str
   str2/str
   str3/str
  /arr
  arr name=description
   strTel to talent 1/str
   strTel to talent 2/str
   strTel to talent 3/str
  /arr
  ...
  /doc
  lst name=highlighting
   lst name=1
   arr name=description
 stremTel/em to talent 1/str
 stremTel/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]
 



Re: highlighting in multiValued field

2011-05-27 Thread Jeffrey Chang
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
  str1/str
  str2/str
  str3/str
 /arr
 arr name=description
  strTel to talent 1/str
  strTel to talent 2/str
  strTel to talent 3/str
 /arr
 ...
 /doc
 lst name=highlighting
  lst name=1
  arr name=description
stremTel/em to talent 1/str
stremTel/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]
 


highlighting in multiValued field

2011-05-26 Thread Jeffrey Chang
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
  strTel to talent 1/str
  strTel 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
stremTel/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
stremTel/em to talent 1/str
stremTel/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


RE: highlighting in multiValued field

2011-05-26 Thread Bob Sandiford
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.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: 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
   strTel to talent 1/str
   strTel 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
 stremTel/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
 stremTel/em to talent 1/str
 stremTel/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



RE: highlighting in multiValued field

2011-05-26 Thread Bob Sandiford
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
   str1/str
   str2/str
   str3/str
 /arr
 arr name=description
   strTel to talent 1/str
   strTel to talent 2/str
   strTel to talent 3/str
 /arr
 ...
 /doc
 lst name=highlighting
   lst name=1
   arr name=description
 stremTel/em to talent 1/str
 stremTel/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]