[pylucene-dev] TopFieldDocs returned from indexSearcher are wrong

Yura Smolsky info at altervisionmedia.com
Tue Sep 12 05:07:33 PDT 2006


Hello, Andi.

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

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

Thanks

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



More information about the pylucene-dev mailing list