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 Jamshaid Ashraf <ja...@gmail.com> on 2013/07/22 09:31:33 UTC

highlighting required in document

Hi,

I'm using solr 4.3.0 & following is the response against hit highlighting
request:

Request: http://localhost:8080/solr/collection2/select?q=content:ps4&hl=true

Response:

<doc>
 <arr name="content"><str>This post is regarding ps4 accuracy and qulaity
which is smooth and factastic</str></arr>
</doc>
<lst name="highlighting">
<lst name="1">
 <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
qulaity which is smooth and factastic</str></arr>
</lst>

I wanted result like this:

<doc>
 <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
qulaity which is smooth and factastic</str></arr>
</doc>
<lst name="highlighting">
<lst name="1">
 <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
qulaity which is smooth and factastic</str></arr>
</lst>

Thanks in advance!

Regards,
Jamshaid

Re: highlighting required in document

Posted by Dmitry Kan <so...@gmail.com>.
Ah, I think I misread your question. So your question is actually, how make
solr embed higlighting into the doc response itself. I'm not aware of such
a functionality. This why you have the "highlighting" section in your
response.


On Tue, Jul 23, 2013 at 2:30 PM, Dmitry Kan <so...@gmail.com> wrote:

> You just need to specify the emphasizing tag in hl params by adding
> something like this to your query:
>
>
>
> &hl.fl=content&hl.simple.pre=<b>&hl.simple.post=<%2Fb>
>
> Check the solr admin page, the querying item, it shows the constructed
> query, so you don't need to guess!
>
> Regards,
>
> Dmitry
>
>
>
> On Mon, Jul 22, 2013 at 10:31 AM, Jamshaid Ashraf <ja...@gmail.com>wrote:
>
>> Hi,
>>
>> I'm using solr 4.3.0 & following is the response against hit highlighting
>> request:
>>
>> Request:
>> http://localhost:8080/solr/collection2/select?q=content:ps4&hl=true
>>
>> Response:
>>
>> <doc>
>>  <arr name="content"><str>This post is regarding ps4 accuracy and qulaity
>> which is smooth and factastic</str></arr>
>> </doc>
>> <lst name="highlighting">
>> <lst name="1">
>>  <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
>> qulaity which is smooth and factastic</str></arr>
>> </lst>
>>
>> I wanted result like this:
>>
>> <doc>
>>  <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
>> qulaity which is smooth and factastic</str></arr>
>> </doc>
>> <lst name="highlighting">
>> <lst name="1">
>>  <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
>> qulaity which is smooth and factastic</str></arr>
>> </lst>
>>
>> Thanks in advance!
>>
>> Regards,
>> Jamshaid
>>
>
>

Re: highlighting required in document

Posted by Dmitry Kan <so...@gmail.com>.
You just need to specify the emphasizing tag in hl params by adding
something like this to your query:



&hl.fl=content&hl.simple.pre=<b>&hl.simple.post=<%2Fb>

Check the solr admin page, the querying item, it shows the constructed
query, so you don't need to guess!

Regards,

Dmitry


On Mon, Jul 22, 2013 at 10:31 AM, Jamshaid Ashraf <ja...@gmail.com>wrote:

> Hi,
>
> I'm using solr 4.3.0 & following is the response against hit highlighting
> request:
>
> Request:
> http://localhost:8080/solr/collection2/select?q=content:ps4&hl=true
>
> Response:
>
> <doc>
>  <arr name="content"><str>This post is regarding ps4 accuracy and qulaity
> which is smooth and factastic</str></arr>
> </doc>
> <lst name="highlighting">
> <lst name="1">
>  <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
> qulaity which is smooth and factastic</str></arr>
> </lst>
>
> I wanted result like this:
>
> <doc>
>  <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
> qulaity which is smooth and factastic</str></arr>
> </doc>
> <lst name="highlighting">
> <lst name="1">
>  <arr name="content"><str>This post is regarding <b>ps4</b> accuracy and
> qulaity which is smooth and factastic</str></arr>
> </lst>
>
> Thanks in advance!
>
> Regards,
> Jamshaid
>