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

Clean up SearchQuery API (less misleading names, fluent interface) #64

Closed
wants to merge 1 commit into from
Closed

Clean up SearchQuery API (less misleading names, fluent interface) #64

wants to merge 1 commit into from

Conversation

chillu
Copy link
Member

@chillu chillu commented May 5, 2015

SearchQuery->search() is highly misleading - it implies that a search is executed,
while in fact it only adds a search term to an internal property.
This gets even more confusing since the actual method executing passing
on the search request to the backend is also called SearchIndex->search().
And many implementations also create a Page_Controller->search() one layer further up.

Renamed other methods along the same lines, for example start() is a confusing
name for adding a start value for pagination, and inClass() implies a boolean
return while in fact its adding a filter.

Also added getters to get naming a bit more consistent (e.g. filter() sets $require).

Set the deprecation notices to 2.0, so a future release.

SearchQuery->search() is highly misleading - it implies that a search is executed,
while in fact it only adds a search term to an internal property.
This gets even more confusing since the actual method executing passing
on the search request to the backend is also called SearchIndex->search().

Renamed other methods along the same lines, for example start() is a confusing
name for adding a start value for pagination, and inClass() implies a boolean
return while in fact its adding a filter.

Also added getters to get naming a bit more consistent (e.g. filter() sets $require).

Set the deprecation notices to 2.0, so a future release.
return $this->limit;
}

function setPageSize($page) {

Choose a reason for hiding this comment

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

I think these methods need public and some phpdoc. I'm not sure what this is doing immediately by reading the code.

@dhensby
Copy link
Contributor

dhensby commented Oct 4, 2016

@chillu - do you have any desire to revisit this and push it over the line?

@andrewandante
Copy link
Contributor

@chillu as part of the ORB work, I'm considering integrating equivalent changes as a way of reducing developer confusion when working with the module. If you're happy for me to lift and tweak I will do so 😄

@chillu
Copy link
Member Author

chillu commented May 14, 2018

If you're happy for me to lift and tweak I will do so

Yes please! Thank you Andrew :)

@dhensby
Copy link
Contributor

dhensby commented May 15, 2018

@chillu can you give contributors push access to your PR branch, please :)

@dhensby
Copy link
Contributor

dhensby commented May 15, 2018

I've rebased this, just need to be able to push it

@dhensby
Copy link
Contributor

dhensby commented May 15, 2018

oh, looks like @andrewandante has already done it in #214

@dhensby dhensby closed this May 15, 2018
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

5 participants