Hello.
object of TopFieldDocs returned from
IndexSearcher.search(Weight weight, Filter filter, int nDocs, Sort
sort) is wrong. Here is piece of code:
from PyLucene import *
dir = FSDirectory.getDirectory("../../index/index", False)
searcher = IndexSearcher(dir)
query = QueryParser("summary", StandardAnalyzer()).parse("good")
weight = query.weight(searcher)
print 'weight:', weight
tfd = searcher.search(weight, None, 10, Sort())
print 'TopFieldDocs:', tfd
print 'TopFieldDocs.fields:', tfd.fields
It tells me this:
weight: weight(summary:good)
TopFieldDocs: [EMAIL PROTECTED]
TopFieldDocs.fields:
Traceback (most recent call last):
File "TopFieldDoc.py", line 14, in ?
print 'TopFieldDocs.fields:', tfd.fields
AttributeError: 'PyLucene.TopDocs' object has no attribute 'fields'
--
Yura Smolsky,
http://altervisionmedia.com/
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev