-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pluggable Ranking Collectors #2
Comments
I was looking for a way to link to the commit history for a branch. If anyone knows the trick to this let me know and I'll add the link to this ticket. |
Is it what your are searching for? 2014/1/13 joelbernstein2013 [email protected]
|
Thanks Vadim. I'll use the link you provided and the link to the branch source tree for each ticket. |
Ok. It's "compare" button right to "pull request" button on branch tree It's worth to add a test, so the others could understand what you are 2014/1/13 joelbernstein2013 [email protected]
|
I agree this needs a test for people to understand it. |
Reopening - looks like my merge-up of trunk closed this accidentally. |
I agree, approach 2 looks best (just looking at the changes to SolrIndexSearcher) |
Yes, not very cool.. There should be a way to avoid it.. 2014/1/15 Yonik Seeley [email protected]
|
Ok, seems like we've got a consensus for design #2. I just added a pluggable MergeStrategy for handling the merge of the docId's from the shards. Like the CollectorFactory you need to add this class to the ResponseBuilder from a custom search component. Now you can control both the local ranking and the distributed merge. Any thoughts on this design? |
Next I'll write some tests to see how it plays out when you plugin a Collector and MergeStrategy |
It would be useful if users could write and plugin their own ranking collectors.
This ticket points to two different design options:
First design:
The first design in this ticket allows users to inject ranking collectors into Heliosearch through an extension of the PostFilter and DelegatingCollector framework.
To add your own ranking collector you extend the new abstract Ranker class and then return a DelegatingCollector that collects a DocList/DocSet rather then filters docs. The DelegatingCollector.finish() method now is passed a reference to the QueryResult so that it can add the DocList and DocSet when finish is called.
You can then plugin your Ranker impl through the QueryParserPlugin mechanism.
The SolrIndexSearcher checks after the call to DelegatingCollector.finish(QueryResult) to see if the QueryResult has a DocList set. If it finds the DocList, it returns without going though the steps of gathering the DocList from the TopDocsCollectors.
The QueryComponent.mergeIds() method has been changed from private to protected so it can be overridden to handle custom ranking logic when merging the docIds from distributed searches.
The initial impl was committed to the plugrank branch in my Heliosearch git repo.
https://github.com/joelbernstein2013/heliosearch/tree/plugrank
https://github.com/joelbernstein2013/heliosearch/compare/plugrank
Second design
The second design allows users to inject ranking collectors through a new CollectorFactory interface. A CollectorFactory can be added to the QueryCommand through a custom search component. The initial impl shows how the SolrIndexSearcher uses the CollectorFactory to plug in a TopDocsCollector if the QueryCommand has the CollectoryFactory set.
I'm leaning towards this design. I think it's cleaner. The user would have to write a custom search component to set the CollectorFactory into the QueryCommand, but if you're advanced enough to write your own TopDocsCollector this should be no problem.
Initial impl was added to the plugrank2 branch on my Heliosearch fork.
https://github.com/joelbernstein2013/heliosearch/tree/plugrank2
https://github.com/joelbernstein2013/heliosearch/compare/plugrank2
The text was updated successfully, but these errors were encountered: