Merged
Conversation
Adding initial serialization methods (readFrom, writeTo) to the PhraseSuggestionBuilder, also adding the base test framework for serialiazation testing, equals and hashCode. Moving SuggestionBuilder out of the global SuggestBuilder for better readability.
With SmoothingModels and CandidateGenerator now beeing able to be serialized via NamedWritable infrastructure, PhraseSuggestionBuilder can now properly delegate read/write and equals/hashCode to their implementations. Also adding randomization of smoothing model and candidate generators to tests.
Added the term suggestion builder's serialization/deserialization and equals/hashCode methods.
Refactored the term suggestion builder for the query refactoring effort
Ensures that the clients' serialization of the sort and string edit distance enumeration values as upper case are correctly normalized when parsing the incoming JSON.
For the ongoing search refactoring (#10217) the PhraseSuggestionBuilder gets a way of parsing from xContent that will eventually replace the current SuggestParseElement. This PR adds the fromXContent method to the PhraseSuggestionBuilder and also adds parsing code for the common suggestion parameters to SuggestionBuilder. Also adding links from the Suggester implementations registeres in the Suggesters registry to the corresponding prototype that is going to be used for parsing once the refactoring is done and we switch from parsing on shard to parsing on coordinating node.
This adds parsing from xContent to PhraseSuggestionBuilder and changes properties of PhraseSuggestionBuilder to using default values form PhraseSuggestionContext where possible.
Conflicts: core/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionContext.java
Add fromXContent method to SuggestBuilder
Feature term suggester xcontent
Conflicts:
core/src/main/java/org/elasticsearch/action/suggest/TransportSuggestAction.java
core/src/main/java/org/elasticsearch/search/suggest/SuggestParseElement.java
core/src/main/java/org/elasticsearch/search/suggest/SuggestionSearchContext.java
core/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggester.java
…nto suggester-wiring-refactoring
Test failures showed problems with passing down the same collate parameter map reference from the phrase suggestion builder to the context where. This changes the collate parameter setters to make a shallow copy of the map passed in.
Fixing some tests and compile problems in reindex module
Change internal representation of suggesters
Conflicts: docs/reference/migration/migrate_5_0.asciidoc
Member
Author
|
@s1monw if you have time, could you take a final look at this? |
Conflicts: docs/reference/migration/migrate_5_0/java.asciidoc
Contributor
|
I think we are good here - I mean I can review it again but it will really only be bikeshedding. These changes have been reviewed before they went into the branch so I think we are more than good with merging it. Here is my formal LGTM to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors all suggestion builders to be able to be parsed on the coordinating node and serialised as Objects to the shards. Specifically, all SuggestionBuilder implementations implement
NamedWritablefor serialization, afromXContent()method that handles parsing from xContent and abuild()method that is called on the shard to create theSuggestionContext.Relates to #10217