Skip to content
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

Keep SearchGroupsResultTransformer concrete #231

Conversation

diegoceccarelli
Copy link

now SearchGroupsResultTransformer is concrete and the different behaviors (normal or skip second step) are achieved by delegating to a private class.

Malvina Josephidou and others added 14 commits April 1, 2019 15:52
…gas patch)

Summary:
In cases where we do grouping and ask for  {{group.limit=1}} only it is possible to skip the second grouping step. In our test datasets it improved speed by around 40%.

Essentially, in the first grouping step each shard returns the top K groups based on the highest scoring document in each group. The top K groups from each shard are merged in the federator and in the second step we ask all the shards to return the top documents from each of the top ranking groups.

If we only want to return the highest scoring document per group we can return the top document id in the first step, merge results in the federator to retain the top K groups and then skip the second grouping step entirely.
…ge (apache#229)

Code looks good, and I agree that we should not skip the steps, thanks!
* sketch: [SkipSecondStep]SearchGroupShardResponseProcessor with inner [SkipSecondStep]SearchGroupsContainer helper class

* sketch: remove/replace SearchGroupsResultTransformer.getInstance

* Callers instead directly allocate either DefaultSearchResultResultTransformer or SkipSecondStepSearchResultResultTransformer.
* A next step could be the proposed SearchGroupsResultTransformer.SkipSecondStepSearchResultResultTransformer inner class to become a SkipSecondStepSearchResultResultTransformer.java class of its own and the proposed SearchGroupsResultTransformer.DefaultSearchResultResultTransformer inner class to _not_ be created with backcompat considerations in mind e.g. SearchGroupsResultTransformer to not become abstract and its constructor to remain public. This assumes that SearchGroupsResultTransformer would require only simple changes to make it extensible and that then SkipSecondStepSearchResultResultTransformer could extend it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants