lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <>
Subject Re: Paging with Lucene
Date Fri, 21 Jan 2011 13:56:51 GMT
> The problem is, that due to the "filtering" AFTER having searched the index, we don't
know how many TopDocs to read in order have "enough" for page x.

Think of a number and double it?  Unless the number get really high
lucene is generally plenty fast enough.  Or read n and if, after
filtering, don't have enough, loop and read n + something.

> Does lucene's search allow injecting kind of a "voter"/"vetoer", which is called for
any hit (ScoreDoc) lucene has encountered. This voter should be able to reject the given hit
from TopDocs (by returning false). Can this be done with a custom Filter?
> This of course comes with a performance penalty, but it would allow to search for n ScoreDocs,
even in our case...

You can use a custom Collector.  From the javadocs:

"Collectors are primarily meant to be used to gather raw results from
a search, and implement sorting or custom result filtering, collation,

Custom result filtering sounds familiar ...


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message