You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Kranti Parisa <kr...@gmail.com> on 2013/11/05 05:50:49 UTC
Custom Collectors with sorting
I am trying to create custom collectors with custom sort preferences.
eventually I want to use them with the following lucene (low level API) call
IndexSearcher.search(query,filter,collector)
1. how can we specify the custom sort along with custom collector
(something like TopFieldCollector ?)
2. I am just wondering is there a way to stop collecting after reaching
some criteria/number. For example: a specific query might result in 1000
hits, means the collect method will be called for 1000 times. but if I have
already collected what I need (custom collecting logic) I want to further
hitting/processing the collect method. we can have if conditions within the
collect method, but just wondering is there any way to break the collect
method and stop collecting ?
Thanks,
Kranti K. Parisa
http://www.linkedin.com/in/krantiparisa