Hello.
Well, I have investigated problem. Actually I cannot get 100th and
more document from Hits when I use implementation of Searchable as
Searcher parameter for ParallelMultiSearcher. When I pass
IndexSearcher as Searcher to it then get works fine.
Check two attached files.
RemoteSearcherOk.py works
RemoteSearcherBad.py does not.
YS> When I use ParallelMultiSearcher I cannot get more that 99th result of
YS> Hits.
YS> hits.doc(99) works and hits.doc(100) does not work. why? :)
YS> Use attached code to reproduce bug.
YS> Yura Smolsky.
Yura Smolsky.
#!/usr/bin/python2.4
from PyLucene import *
class RemoteSearcher(Object):
def __init__(self, local):
self.local = local
def close(self):
self.local.close()
def docFreq(self, term):
return self.local.docFreq(term)
def maxDoc(self):
return self.local.maxDoc()
def searchAll(self, query, filter, hitCollector):
return self.local.search(query, filter, hitCollector)
def search(self, query, filter, n):
return self.local.search(query, filter, n)
def searchSorted(self, query, filter, n, sort):
return self.local.search(query, filter, n, sort)
def doc(self, i):
return self.local.doc(i)
def rewrite(self, original):
return self.local.rewrite(original)
def explain(self, query, doc):
return self.local.explain(query, doc)
dir = FSDirectory.getDirectory("index/index03", False)
a = StandardAnalyzer()
searcher = IndexSearcher(dir)
remote = RemoteSearcher(searcher)
sort = Sort()
# create MultiSearcher with one Searcher
parallel = ParallelMultiSearcher([remote])
query = QueryParser.parse("good", "content", a)
hits = parallel.search(query, sort)
print hits.length()
for i in range(hits.length()):
print i,
hits.doc(i)#!/usr/bin/python2.4
from PyLucene import *
dir = FSDirectory.getDirectory("index/index03", False)
a = StandardAnalyzer()
searcher = IndexSearcher(dir)
sort = Sort()
#sort.setSort([SortField("modified", SortField.STRING, True)])
# create MultiSearcher with one Searcher
parallel = ParallelMultiSearcher([searcher])
query = QueryParser.parse("good", "content", a)
hits = parallel.search(query, sort)
print hits.length()
for i in range(hits.length()):
print i,
hits.doc(i)_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev