You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by David Xiao <da...@gmail.com> on 2007/04/22 08:31:02 UTC

The ability to offering offset of keyword in search result

Is that a feature that can identify offset of keyword in search result?

 

For example, if there is a following text to be indexed:

In God We Trust – Each dollar had this

And user search for: Each, should return with value: 19. Means first occurs at character 19.

 

I am not sure if lucene or solr will, have provide this functionality? Do you thought that could be useful to help give some search result context? Like google search does.

 

Regards,

David


RE: The ability to offering offset of keyword in search result

Posted by David Xiao <da...@gmail.com>.
It works! 
By the way, fl=field1+field2+.... also works :-)



-----Original Message-----
From: Mike Klaas [mailto:mike.klaas@gmail.com] 
Sent: Wednesday, May 02, 2007 1:40 AM
To: solr-dev@lucene.apache.org
Subject: Re: The ability to offering offset of keyword in search result

On 5/1/07, David Xiao <da...@gmail.com> wrote:
> Would you please give me an example? For example, I want to pick only fieldname="features"
> from the query result

Try something like:

?q=a+query&hl=true&hl.fl=features&fl=features

-Mike


Re: The ability to offering offset of keyword in search result

Posted by Mike Klaas <mi...@gmail.com>.
On 5/1/07, David Xiao <da...@gmail.com> wrote:
> Would you please give me an example? For example, I want to pick only fieldname="features"
> from the query result

Try something like:

?q=a+query&hl=true&hl.fl=features&fl=features

-Mike

RE: The ability to offering offset of keyword in search result

Posted by David Xiao <da...@gmail.com>.
Would you please give me an example? For example, I want to pick only fieldname="features"
from the query result

Regards,
David


-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: Tuesday, April 24, 2007 1:50 AM
To: solr-dev@lucene.apache.org
Subject: RE: The ability to offering offset of keyword in search result


: It come up with another question: In response XML, can I suppress output
: of <result name="">.... section? Because I only need highlight section.

well ... not really, you can say rows=0 but then you won't get
highlighting either.

you can use "fl" to make it smaller though (just pick only one field,
score or your uniqueKey perhaps)


-Hoss


RE: The ability to offering offset of keyword in search result

Posted by Chris Hostetter <ho...@fucit.org>.
: It come up with another question: In response XML, can I suppress output
: of <result name="">.... section? Because I only need highlight section.

well ... not really, you can say rows=0 but then you won't get
highlighting either.

you can use "fl" to make it smaller though (just pick only one field,
score or your uniqueKey perhaps)


-Hoss


RE: The ability to offering offset of keyword in search result

Posted by David Xiao <da...@gmail.com>.
Appreciate that, just work perfect! 
It come up with another question: In response XML, can I suppress output of <result name="">.... section? Because I only need highlight section.

Appreciate in advance again!


-----Original Message-----
From: Ryan McKinley [mailto:ryantxu@gmail.com] 
Sent: Monday, April 23, 2007 1:44 AM
To: solr-dev@lucene.apache.org
Subject: Re: The ability to offering offset of keyword in search result

David Xiao wrote:
> Thanks. It looks like what I need but I am not quite understand how it actually modify SolrConfig.xml to 
> enable highlight.
> 
> Is there an example xml snippet for? 
> 
>

You don't need to modify solrconfig.xml.  Just add parameters to the 
query string.  For example with the sample data, try:

http://localhost:8983/solr/select?q=power&hl=true&hl.fl=name

you'll get a highlighting section at the bottom


> 
> 
> -----Original Message-----
> From: Ryan McKinley [mailto:ryantxu@gmail.com] 
> Sent: Sunday, April 22, 2007 2:39 PM
> To: solr-dev@lucene.apache.org
> Subject: Re: The ability to offering offset of keyword in search result
> 
> 
> are you looking for highlighting?
> http://wiki.apache.org/solr/HighlightingParameters
> 
> This would give you:
>   In God We Trust – <em>Each</em> dollar had this
> 
> 
> David Xiao wrote:
>> Is that a feature that can identify offset of keyword in search result?
>>
>>  
>>
>> For example, if there is a following text to be indexed:
>>
>> In God We Trust – Each dollar had this
>>
>> And user search for: Each, should return with value: 19. Means first occurs at character 19.
>>
>>  
>>
>> I am not sure if lucene or solr will, have provide this functionality? Do you thought that could be useful to help give some search result context? Like google search does.
>>
>>  
>>
>> Regards,
>>
>> David
>>
>>
> 
> 


Re: The ability to offering offset of keyword in search result

Posted by Ryan McKinley <ry...@gmail.com>.
David Xiao wrote:
> Thanks. It looks like what I need but I am not quite understand how it actually modify SolrConfig.xml to 
> enable highlight.
> 
> Is there an example xml snippet for? 
> 
>

You don't need to modify solrconfig.xml.  Just add parameters to the 
query string.  For example with the sample data, try:

http://localhost:8983/solr/select?q=power&hl=true&hl.fl=name

you'll get a highlighting section at the bottom


> 
> 
> -----Original Message-----
> From: Ryan McKinley [mailto:ryantxu@gmail.com] 
> Sent: Sunday, April 22, 2007 2:39 PM
> To: solr-dev@lucene.apache.org
> Subject: Re: The ability to offering offset of keyword in search result
> 
> 
> are you looking for highlighting?
> http://wiki.apache.org/solr/HighlightingParameters
> 
> This would give you:
>   In God We Trust – <em>Each</em> dollar had this
> 
> 
> David Xiao wrote:
>> Is that a feature that can identify offset of keyword in search result?
>>
>>  
>>
>> For example, if there is a following text to be indexed:
>>
>> In God We Trust – Each dollar had this
>>
>> And user search for: Each, should return with value: 19. Means first occurs at character 19.
>>
>>  
>>
>> I am not sure if lucene or solr will, have provide this functionality? Do you thought that could be useful to help give some search result context? Like google search does.
>>
>>  
>>
>> Regards,
>>
>> David
>>
>>
> 
> 


RE: The ability to offering offset of keyword in search result

Posted by David Xiao <da...@gmail.com>.
Thanks. It looks like what I need but I am not quite understand how it actually modify SolrConfig.xml to 
enable highlight.

Is there an example xml snippet for? 




-----Original Message-----
From: Ryan McKinley [mailto:ryantxu@gmail.com] 
Sent: Sunday, April 22, 2007 2:39 PM
To: solr-dev@lucene.apache.org
Subject: Re: The ability to offering offset of keyword in search result


are you looking for highlighting?
http://wiki.apache.org/solr/HighlightingParameters

This would give you:
  In God We Trust – <em>Each</em> dollar had this


David Xiao wrote:
> Is that a feature that can identify offset of keyword in search result?
> 
>  
> 
> For example, if there is a following text to be indexed:
> 
> In God We Trust – Each dollar had this
> 
> And user search for: Each, should return with value: 19. Means first occurs at character 19.
> 
>  
> 
> I am not sure if lucene or solr will, have provide this functionality? Do you thought that could be useful to help give some search result context? Like google search does.
> 
>  
> 
> Regards,
> 
> David
> 
> 


Re: The ability to offering offset of keyword in search result

Posted by Ryan McKinley <ry...@gmail.com>.
are you looking for highlighting?
http://wiki.apache.org/solr/HighlightingParameters

This would give you:
  In God We Trust – <em>Each</em> dollar had this


David Xiao wrote:
> Is that a feature that can identify offset of keyword in search result?
> 
>  
> 
> For example, if there is a following text to be indexed:
> 
> In God We Trust – Each dollar had this
> 
> And user search for: Each, should return with value: 19. Means first occurs at character 19.
> 
>  
> 
> I am not sure if lucene or solr will, have provide this functionality? Do you thought that could be useful to help give some search result context? Like google search does.
> 
>  
> 
> Regards,
> 
> David
> 
>