Refactor PhraseSuggestionBuilder.DirectCandidateGenerator#16185
Refactor PhraseSuggestionBuilder.DirectCandidateGenerator#16185cbuescher merged 1 commit intoelastic:masterfrom
Conversation
f9c3602 to
8428028
Compare
8428028 to
0735e24
Compare
There was a problem hiding this comment.
Can we make this either PhraseSuggestionBuilder.DirectCandidateGenerator or DirectCandidateGenerator?
There was a problem hiding this comment.
I would have really liked to pull this to its own class, but there is already org.elasticsearch.search.suggest.phrase.DirectCandidateGenerator which is the same thing but with shard-dependent properties (Analyzers etc...), so I will rename this thing to DirectCandidateGeneratorBuilder.
There was a problem hiding this comment.
Or just reference it as PhraseSuggestionBuilder.DirectCandidateGenerator instead of its FQCN
There was a problem hiding this comment.
I prefer pulling this out, PhraseSuggestionBuilder is large enough already.
|
left a couple of minor comments but it LGTM |
As a prerequisite for refactoring the whole PhraseSuggestionBuilder to be able to be parsed and streamed from the coordinating node, the DirectCandidateGenerator must implement Writeable, be able to parse a new instance (fromXContent()) and later when transported to the shard to generate a PhraseSuggestionContext.DirectCandidateGenerator. Also adding equals/hashCode and tests and moving DirectCandidateGenerator to its own DirectCandidateGeneratorBuilder class.
0735e24 to
61c435e
Compare
As a prerequisite for refactoring the whole PhraseSuggestionBuilder to be able to be parsed and streamed from the coordinating node, the DirectCandidateGenerator must implement Writeable, be able to parse a new instance (fromXContent()) and later when transported to the shard to generate a PhraseSuggestionContext.DirectCandidateGenerator. Also adding equals/hashCode and tests and moving DirectCandidateGenerator to its own DirectCandidateGeneratorBuilder class.
|
@colings86 thanks for the review. |
As a prerequisite for refactoring the whole PhraseSuggestionBuilder to be able to be parsed and streamed from the coordinating node, the DirectCandidateGenerator must implement Writeable, be able to parse a new instance (fromXContent()) and later when transported to the shard to generate a PhraseSuggestionContext.DirectCandidateGenerator. Also adding equals/hashCode and tests and moving DirectCandidateGenerator to its own DirectCandidateGeneratorBuilder class.
Relates to #10217