You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Eugene Ezekiel <u0...@nus.edu.sg> on 2005/12/07 10:02:59 UTC

Similarity scores for all docs

Hi,

Is there any way to get the similarity scores for each document in the 
index? I can iterate thru each doc in the index using the IndexReader 
but not sure how to get the similarity score for that doc.


Thanks.

--
Regards,
Eugene

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Similarity scores for all docs

Posted by Grant Ingersoll <gs...@syr.edu>.
You can use the HitCollector mechanism to fill your array, but what you 
are doing is essentially what the Hits object already does, plus it 
provides caching

Eugene Ezekiel wrote:

> Yes, but what I wanna be able to do is something like, fill an array of
> say size 100 such that:
> array[0] = similarity value of query and doc(0)
> array[1] = similarity value of query and doc(1)
> ....
>
> Any idea how to fill this array?
>
> Thanks.
> -- 
> Regards,
> Eugene
>
> Koji Sekiguchi wrote:
>
>> You can get scores by calling Hits.score(). So you should search
>> at first to get Hits object.
>>
>> regards,
>>
>> Koji
>>
>>> -----Original Message-----
>>> From: Eugene Ezekiel [mailto:u0200783@nus.edu.sg]
>>> Sent: Wednesday, December 07, 2005 6:03 PM
>>> To: java-user@lucene.apache.org
>>> Subject: Similarity scores for all docs
>>>
>>>
>>> Hi,
>>>
>>> Is there any way to get the similarity scores for each document in 
>>> the index? I can iterate thru each doc in the index using the 
>>> IndexReader but not sure how to get the similarity score for that doc.
>>>
>>>
>>> Thanks.
>>>
>>> -- 
>>> Regards,
>>> Eugene
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

-- 
------------------------------------------------------------------- 
Grant Ingersoll 
Sr. Software Engineer 
Center for Natural Language Processing 
Syracuse University 
School of Information Studies 
337 Hinds Hall 
Syracuse, NY 13244 

http://www.cnlp.org 
Voice:  315-443-5484 
Fax: 315-443-6886 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Similarity scores for all docs

Posted by Eugene Ezekiel <u0...@nus.edu.sg>.
Yes, but what I wanna be able to do is something like, fill an array of
say size 100 such that:
array[0] = similarity value of query and doc(0)
array[1] = similarity value of query and doc(1)
....

Any idea how to fill this array?

Thanks.
--
Regards,
Eugene

Koji Sekiguchi wrote:
> You can get scores by calling Hits.score(). So you should search
> at first to get Hits object.
> 
> regards,
> 
> Koji
> 
>> -----Original Message-----
>> From: Eugene Ezekiel [mailto:u0200783@nus.edu.sg]
>> Sent: Wednesday, December 07, 2005 6:03 PM
>> To: java-user@lucene.apache.org
>> Subject: Similarity scores for all docs
>>
>>
>> Hi,
>>
>> Is there any way to get the similarity scores for each document in the 
>> index? I can iterate thru each doc in the index using the IndexReader 
>> but not sure how to get the similarity score for that doc.
>>
>>
>> Thanks.
>>
>> --
>> Regards,
>> Eugene
>> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: Similarity scores for all docs

Posted by Koji Sekiguchi <ko...@m4.dion.ne.jp>.
You can get scores by calling Hits.score(). So you should search
at first to get Hits object.

regards,

Koji

> -----Original Message-----
> From: Eugene Ezekiel [mailto:u0200783@nus.edu.sg]
> Sent: Wednesday, December 07, 2005 6:03 PM
> To: java-user@lucene.apache.org
> Subject: Similarity scores for all docs
> 
> 
> Hi,
> 
> Is there any way to get the similarity scores for each document in the 
> index? I can iterate thru each doc in the index using the IndexReader 
> but not sure how to get the similarity score for that doc.
> 
> 
> Thanks.
> 
> --
> Regards,
> Eugene
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org