On Thu, 23 Feb 2006, David Pratt wrote:

Hi. I've read a few things about paging functionality for the searcher. I have already rolled my own in the meantime for batching and paging but still wondering if this functionality already exists somewhere that I am just unaware of. I am providing a start position and calculating an end position for xrange based on hits.length() to keep the end position within the range of results. In any case, I read:

Hits hits = searcher.search(query, new PageFilter(1,20));

In another, this version:

hits = searcher.search(query, 0, 10);

I could not locate a PageFilter method in the java docs and the second method throws an exception.

I'm not sure I understand your question exactly but there is no class called PageFilter in the Java Lucene code base. Hence there is no such class in PyLucene either. If you wrote your own PageFilter in Java and are wondering about how to integrate it into PyLucene, you can actually write in python by creating a class with a method named 'bits' taking an IndexReader instance and returning a Java BitSet instance (exported by PyLucene), as is done, for example, in the test_FilteredQuery.py unit test. This is somewhat documented in the README file under 'Extending Java Lucene classes from Python'.

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

Reply via email to