You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by chamara <ch...@gmail.com> on 2013/03/19 13:29:51 UTC

SOLRCloud dynamic teaser (hit highlighting)

I am using SOLRCloud 4.1 
I have a document as follows

<tag>car</tag>
<body>this is a body of the document that talks about vehicles</body>

When this gets indexed i create copy the content to the "text" default
field.

results in:text field for this doc

<str>car </str>
<str>this is a body of the document that talks about vehicles</str>


when i search for "car" and have the hit highlighting turned on , this
document appears in the results, but the highlighted fragment is only "car".
Even though i change the fl.fragment to a maximum number without any luck.

 I know the results returned is correct but i just want to add static
content if the hit highlighter only shows string of the size of less than 10
for example. I currently do this in the front end to append the body field
if the highlighter has a smaller fragment.


Is there any option to do this in the SolrConfig itself?





--
View this message in context: http://lucene.472066.n3.nabble.com/SOLRCloud-dynamic-teaser-hit-highlighting-tp4048930.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLRCloud dynamic teaser (hit highlighting)

Posted by Upayavira <uv...@odoko.co.uk>.
There's no way you can do this within the scope of text analysis I would
say.

You would be better off preparing a separate field within your indexing
code, or, if you don't have this option, you could do it in an
UpdateProcessor, perhaps the ScriptUpdateProcessor might be of use -
basically, prepare an additional field in your update processor chain
that contains everything you want to highlight upon. Note, update
processors are called *before* fields are stored, so as far as the index
is concerned, your new field is just one single non-multivalued field.

Upayavira

On Tue, Mar 19, 2013, at 01:03 PM, chamara wrote:
> Thanks for your reply. Sorry i forgot to mention that the it is using the
> text field and it is stored = true. and i am getting back highlighted
> snippets as well. It is just that I need a longer fragment.(What i need
> is
> something like when i copy the fields to text to make sure it does not
> add
> them as multivalues and concatenate it to achieve my requirement. Is
> there a
> better way to do this?
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/SOLRCloud-dynamic-teaser-hit-highlighting-tp4048930p4048937.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLRCloud dynamic teaser (hit highlighting)

Posted by chamara <ch...@gmail.com>.
Thanks for your reply. Sorry i forgot to mention that the it is using the
text field and it is stored = true. and i am getting back highlighted
snippets as well. It is just that I need a longer fragment.(What i need is
something like when i copy the fields to text to make sure it does not add
them as multivalues and concatenate it to achieve my requirement. Is there a
better way to do this?



--
View this message in context: http://lucene.472066.n3.nabble.com/SOLRCloud-dynamic-teaser-hit-highlighting-tp4048930p4048937.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLRCloud dynamic teaser (hit highlighting)

Posted by Upayavira <uv...@odoko.co.uk>.
What field are you doing your hit highlighting on? You need to look at
the configuration for the highlighting component in solrconfig.xml. Also
note that you can only highlight on *stored* fields. The 'text' field is
by default not stored, so you'd need to change that and re-index.

Upayavira

On Tue, Mar 19, 2013, at 12:29 PM, chamara wrote:
> I am using SOLRCloud 4.1 
> I have a document as follows
> 
> <tag>car</tag>
> <body>this is a body of the document that talks about vehicles</body>
> 
> When this gets indexed i create copy the content to the "text" default
> field.
> 
> results in:text field for this doc
> 
> <str>car </str>
> <str>this is a body of the document that talks about vehicles</str>
> 
> 
> when i search for "car" and have the hit highlighting turned on , this
> document appears in the results, but the highlighted fragment is only
> "car".
> Even though i change the fl.fragment to a maximum number without any
> luck.
> 
>  I know the results returned is correct but i just want to add static
> content if the hit highlighter only shows string of the size of less than
> 10
> for example. I currently do this in the front end to append the body
> field
> if the highlighter has a smaller fragment.
> 
> 
> Is there any option to do this in the SolrConfig itself?
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/SOLRCloud-dynamic-teaser-hit-highlighting-tp4048930.html
> Sent from the Solr - User mailing list archive at Nabble.com.