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

Extract and Implement ResultSetBuilder #1065

Merged
merged 1 commit into from Apr 28, 2016
Merged

Conversation

merk
Copy link
Collaborator

@merk merk commented Mar 24, 2016

As per #1017, this PR contains the extraction of ResultSetBuilder.

Please consider this for merging.

This PR technically creates a BC break for anyone using ResultSet::$_class and ResultSet::create().

@@ -462,7 +463,7 @@ public function search($query = '', $options = null)
$params
);

return ResultSet::create($response, $query);
return $this->_client->getResultSetBuilder()->buildResultSet($response, $query);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would prefer to inject the ResultSetBuilder directly into the Search object, but I think given the way Elastica is structured that developers will be creating these objects directly and we dont want to introduce such a major change..

@merk merk mentioned this pull request Mar 24, 2016
@merk merk force-pushed the resultset-builder branch 6 times, most recently from d497713 to b9a158e Compare March 26, 2016 05:10
*/
protected $_connectionPool = null;
Copy link
Owner

Choose a reason for hiding this comment

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

This breaks BC in case someone extended the Client. Not something that prevents us from moving forward, but worth mentioning in the CHANGELOG.md.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The connection pool remains protected, my habit of alphabetising properties strikes here, its just now on line 54.

@ruflin
Copy link
Owner

ruflin commented Mar 27, 2016

As mentioned before I think this definitively goes in the right direction. I did quite a brief review but I saw that the changes to the public APIs and tests are minimal which is great to make it easier for people to migrate (which in most cases is not needed). Could you update the CHANGELOG.md with the BC breaks?

@merk
Copy link
Collaborator Author

merk commented Mar 27, 2016

Regarding the ResultSet $_results variable, to make it simpler we could leave it protected and deprecate it for a major bump instead? That would mean this change has almost no effect on any current users..

@ruflin
Copy link
Owner

ruflin commented Mar 28, 2016

@merk That would be great, if we could deprecate it first. Like this we could do the release as following:

  • 3.x with new feature and deprecations
  • 4.x with feature removed

This gives people the opportunity to update the lib to the most recent version first without breaking their app but they already see what they have to change.

@merk merk force-pushed the resultset-builder branch 3 times, most recently from 5a8930a to 4e2fa40 Compare March 28, 2016 09:21
@merk
Copy link
Collaborator Author

merk commented Mar 28, 2016

I have moved ResultSet properties back to protected with deprecations and updated the CHANGELOG file.

@ruflin
Copy link
Owner

ruflin commented Apr 25, 2016

@merk Sorry, took me some time here to get back to this one. Could you rebase on top of master so I can merge this one in?

@ruflin
Copy link
Owner

ruflin commented Apr 26, 2016

@merk BTW: ping when you rebase, as Github does not send notifications for this :-(

@merk
Copy link
Collaborator Author

merk commented Apr 26, 2016

Rebased.

@ruflin
Copy link
Owner

ruflin commented Apr 27, 2016

Argh, seems you have to rebase again as it conflicts with the logging PR :-(

@merk
Copy link
Collaborator Author

merk commented Apr 28, 2016

Squashed and rebased

@ruflin ruflin merged commit fec4aca into ruflin:master Apr 28, 2016
@ruflin
Copy link
Owner

ruflin commented Apr 28, 2016

Merged. Thanks.

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.

None yet

2 participants