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 Furkan KAMACI <fu...@gmail.com> on 2013/11/20 16:37:42 UTC

How to Configure Highlighting for Solr

I have setup my highlight as follows:

     <bool name="hl">true</bool>
     <str name="hl.fl">name age address</str>

However I don't want *name* be highlighted *but *included inside response:

"highlighting": {
 Something_myid: {
    name: "<em>Something</em> bla bla",
    age: "<em>Something</em> age bla bla",
    address: "<em>Something</em> age bla bla"
  }
}

*or:*

I want to group them on name field instead of id:

"highlighting": {
 Something bla bla: {
    age: "<em>Something</em> age bla bla",
    address: "<em>Something</em> age bla bla"
  }
}

*or*

"highlighting": {
 Something bla bla: {
    name: "<em>Something</em> bla bla",
    age: "<em>Something</em> age bla bla",
    address: "<em>Something</em> age bla bla"
  }
}

How can I do *any* of them at Solr 4.5.1?

Re: How to Configure Highlighting for Solr

Posted by Furkan KAMACI <fu...@gmail.com>.
I have implemented a search API that interacts with Solr. I don't retrieve
id field. Id field is a transformed version of name field and it helps to
make a quicker search on index. It would be nice to declare to Solr that I
have another field that is unique too and it would be nice to group
highlighting on that unique field instead of id.

Thanks;
Furkan KAMACI


20 Kasım 2013 Çarşamba tarihinde Stefan Matheis <ma...@gmail.com>
adlı kullanıcı şöyle yazdı:
> Solr is using the UniqueKey you defined for your documents, that
shouldn't be a problem, since you can lookup the document from the list of
documents in the main response?
>
> And there is actually a ticket, which would allow it to inline the
highlight response with DocTransfomers:
https://issues.apache.org/jira/browse/SOLR-3479
>
> -Stefan
>
>
> On Wednesday, November 20, 2013 at 4:37 PM, Furkan KAMACI wrote:
>
>> I have setup my highlight as follows:
>>
>> <bool name="hl">true</bool>
>> <str name="hl.fl">name age address</str>
>>
>> However I don't want *name* be highlighted *but *included inside
response:
>>
>> "highlighting": {
>> Something_myid: {
>> name: "<em>Something</em> bla bla",
>> age: "<em>Something</em> age bla bla",
>> address: "<em>Something</em> age bla bla"
>> }
>> }
>>
>> *or:*
>>
>> I want to group them on name field instead of id:
>>
>> "highlighting": {
>> Something bla bla: {
>> age: "<em>Something</em> age bla bla",
>> address: "<em>Something</em> age bla bla"
>> }
>> }
>>
>> *or*
>>
>> "highlighting": {
>> Something bla bla: {
>> name: "<em>Something</em> bla bla",
>> age: "<em>Something</em> age bla bla",
>> address: "<em>Something</em> age bla bla"
>> }
>> }
>>
>> How can I do *any* of them at Solr 4.5.1?
>
>

Re: How to Configure Highlighting for Solr

Posted by Stefan Matheis <ma...@gmail.com>.
Solr is using the UniqueKey you defined for your documents, that shouldn't be a problem, since you can lookup the document from the list of documents in the main response?

And there is actually a ticket, which would allow it to inline the highlight response with DocTransfomers: https://issues.apache.org/jira/browse/SOLR-3479

-Stefan 


On Wednesday, November 20, 2013 at 4:37 PM, Furkan KAMACI wrote:

> I have setup my highlight as follows:
> 
> <bool name="hl">true</bool>
> <str name="hl.fl">name age address</str>
> 
> However I don't want *name* be highlighted *but *included inside response:
> 
> "highlighting": {
> Something_myid: {
> name: "<em>Something</em> bla bla",
> age: "<em>Something</em> age bla bla",
> address: "<em>Something</em> age bla bla"
> }
> }
> 
> *or:*
> 
> I want to group them on name field instead of id:
> 
> "highlighting": {
> Something bla bla: {
> age: "<em>Something</em> age bla bla",
> address: "<em>Something</em> age bla bla"
> }
> }
> 
> *or*
> 
> "highlighting": {
> Something bla bla: {
> name: "<em>Something</em> bla bla",
> age: "<em>Something</em> age bla bla",
> address: "<em>Something</em> age bla bla"
> }
> }
> 
> How can I do *any* of them at Solr 4.5.1?