Paginating results from couchdb-lucene
I can easily paginate results coming 开发者_如何学JAVAdirectly from couchdb (using startkey and limit) but looks like couchdb-lucene does not handle 'startkey' argument passed in a request. I still can use 'skip' but as far as I remember it's deprecated way of paginating with couch.
So, is there any other way of effective pagination with couchdb-lucene?
I think you're looking for couchdb-lucene's skip
and limit
query parameters.
Quoting the couchdb-lucene documentation
skip
: the number of results to skip
limit
: the maximum number of results to return
I realize that you're trying to avoid processing all of the skipped documents, but core Lucene doesn't offer any help to couchdb-lucene there:
To quote the Apache Lucene documentation:
How do I implement paging, i.e. showing result from 1-10, 11-20 etc?
Just re-execute the search and ignore the hits you don't want to show. As people usually look only at the first results this approach is usually fast enough.
精彩评论