Hello, Andi.

AV> On Tue, 12 Sep 2006, Yura Smolsky wrote:

>> another issue... when I perform search on the field like this:
>> Field("link", link, Field.Store.YES, Field.Index.UN_TOKENIZED)
>>
>> I got weird value of maxScore of TopFieldDocs.
>>
>> Here is program:
>> from PyLucene import *
>>
>> dir = FSDirectory.getDirectory("../../index/index", False)
>> searcher = IndexSearcher(dir)
>> query = PrefixQuery(Term("link", "yahoo.com"))
>> print query
>> weight = query.weight(searcher)
>> tfd = searcher.search(weight, None, 10, Sort())
>> print 'TopFieldDocs.maxScore:', tfd.getMaxScore()
>>
>> output:
>> link:yahoo.com*
>> TopFieldDocs.maxScore: -1.#INF
>>

AV> That value should be -inf. Apparently, the maxScore is initialized to -inf
AV> (negative infinity) in Lucene's FieldSortedHitQueue.java, line 77:

AV>    /** Stores the maximum score value encountered, needed for normalizing. 
*/
AV>    protected float maxscore = Float.NEGATIVE_INFINITY;

>> and of course I cannot build object of TopFieldDocs with such value. I
>> am not sure where is error.. Please check.

AV> In python, to create a float with negative infinity you say: float('-inf')

so I need to recreate this value?

--
Yura Smolsky,
http://altervisionmedia.com/


_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to