Skip to content

Initial refactoring for phrase suggester#16241

Closed
cbuescher wants to merge 1 commit intoelastic:masterfrom
cbuescher:init-phraseSuggester-refactoring
Closed

Initial refactoring for phrase suggester#16241
cbuescher wants to merge 1 commit intoelastic:masterfrom
cbuescher:init-phraseSuggester-refactoring

Conversation

@cbuescher
Copy link
Copy Markdown
Member

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.

Still missing: Handling of Smoothing Model (depends on #16130) and DirectCandidateGenerator (depends on #16185). Also Test needs to be extended to handle all parameters.

@cbuescher cbuescher added review :Search Relevance/Suggesters "Did you mean" and suggestions as you type labels Jan 26, 2016
@cbuescher cbuescher force-pushed the init-phraseSuggester-refactoring branch 5 times, most recently from 6afb09c to 8440320 Compare January 27, 2016 12:59
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we at some point want to move towards genuine getters and setters?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since almost all of the setters here are not get/set I wanted to make it consistent without too much changes. I'm happy to rename them all together in one go at a later stage though. Also if anybody else objects I can change this back of course, I just don't want to change all the non-get/set type ones at this point.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - makes sense. Maybe track the final move to get/set in a separate issue?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the motivation for wanting to make them genuine "get/set" methods?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abeyad to my knowledge there was an ungoing debate. Last issue I can find is this #14266 but it also states that it might be good to do this in one go.

@MaineC
Copy link
Copy Markdown

MaineC commented Jan 27, 2016

Left a few comments. Feel free to ignore the ones about methods being empty. I didn't realize this wasn't going against master.

@cbuescher cbuescher force-pushed the init-phraseSuggester-refactoring branch 2 times, most recently from 025391f to 600a8f8 Compare January 27, 2016 14:09
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be "get token separator"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, thanks

@cbuescher
Copy link
Copy Markdown
Member Author

@areek @abeyad thanks for the review, I hope I adressed all of your comments, any objections about merging this then?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@abeyad
Copy link
Copy Markdown

abeyad commented Jan 27, 2016

@cbuescher LGTM ++

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can make this private, I assume this is only for readability?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will change that as well. And yes, currently only for readability. I hope we keep the same name constants as Id in the stream as well as for registering the parsers. That's what worked for queries at least.

@areek
Copy link
Copy Markdown
Contributor

areek commented Jan 27, 2016

@cbuescher LGTM. This looks great and thanks for the test infra :)

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.
@cbuescher cbuescher force-pushed the init-phraseSuggester-refactoring branch from 29ca712 to 86db250 Compare January 27, 2016 16:11
@cbuescher
Copy link
Copy Markdown
Member Author

Didn't merge this with master but with feature-suggest-refactoring branch in c00c0fa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants