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 SolrUser1543 <os...@gmail.com> on 2014/09/14 20:35:01 UTC

Altenative preview for specific fields

Suppose I have the following fields : 

text,author,title

users performs a query on all those fileds : 

...?q=(text:XX OR author:XX OR title:XX)

if this query has a match in 'text' field , so highligter will generate a
hit preview based on this field , which is fine . 

But suppose a query matched an 'author' field , so the preview will not be 
much intresting . 
In this case I would like to show something else e.g. first 3 lines of
'text' filed. 

What will be the best way to achive this ? 







--
View this message in context: http://lucene.472066.n3.nabble.com/Altenative-preview-for-specific-fields-tp4158771.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Altenative preview for specific fields

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi,

f.text.hl.alternateField=text&f.text.hl.maxAlternateFieldLength=500 will display first 500 characters of text field.



On Monday, September 15, 2014 8:38 AM, SolrUser1543 <os...@gmail.com> wrote:
Hi , thanks for the answer. 

I tried to use this technique , but the desired result was not achieved. 

Can you please provide an example of document to index and some sample query
?



--
View this message in context: http://lucene.472066.n3.nabble.com/Altenative-preview-for-specific-fields-tp4158771p4158807.html



Sent from the Solr - User mailing list archive at Nabble.com.


Re: Altenative preview for specific fields

Posted by SolrUser1543 <os...@gmail.com>.
Hi , thanks for the answer. 

I tried to use this technique , but the desired result was not achieved. 

Can you please provide an example of document to index and some sample query
?



--
View this message in context: http://lucene.472066.n3.nabble.com/Altenative-preview-for-specific-fields-tp4158771p4158807.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Altenative preview for specific fields

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi,

hl.alternateField and hl.maxAlternateFieldLength would be useful.

http://wiki.apache.org/solr/HighlightingParameters

Ahmet


On Sunday, September 14, 2014 9:35 PM, SolrUser1543 <os...@gmail.com> wrote:



Suppose I have the following fields : 

text,author,title

users performs a query on all those fileds : 

...?q=(text:XX OR author:XX OR title:XX)

if this query has a match in 'text' field , so highligter will generate a
hit preview based on this field , which is fine . 

But suppose a query matched an 'author' field , so the preview will not be 
much intresting . 
In this case I would like to show something else e.g. first 3 lines of
'text' filed. 

What will be the best way to achive this ? 







--
View this message in context: http://lucene.472066.n3.nabble.com/Altenative-preview-for-specific-fields-tp4158771.html
Sent from the Solr - User mailing list archive at Nabble.com.