Skip to content

Refactoring of Suggestions#17096

Merged
cbuescher merged 78 commits intomasterfrom
feature-suggest-refactoring
Mar 16, 2016
Merged

Refactoring of Suggestions#17096
cbuescher merged 78 commits intomasterfrom
feature-suggest-refactoring

Conversation

@cbuescher
Copy link
Copy Markdown
Member

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 NamedWritable for serialization, a fromXContent() method that handles parsing from xContent and a build() method that is called on the shard to create the SuggestionContext.

Relates to #10217

cbuescher and others added 30 commits January 27, 2016 17:16
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
Ali Beyad and others added 14 commits March 10, 2016 00:14
 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
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
@cbuescher
Copy link
Copy Markdown
Member Author

@s1monw if you have time, could you take a final look at this?

 Conflicts:
	docs/reference/migration/migrate_5_0/java.asciidoc
@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented Mar 16, 2016

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

@cbuescher cbuescher merged commit 6ddf9ae into master Mar 16, 2016
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Search Refactoring labels Feb 14, 2018
@jasontedor jasontedor deleted the feature-suggest-refactoring branch December 10, 2019 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Relevance/Suggesters "Did you mean" and suggestions as you type :Search/Search Search-related issues that do not fall into other categories v5.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants