Skip to content

Refactor search#5

Merged
mboynes merged 24 commits intomasterfrom
search-refactor
Aug 22, 2014
Merged

Refactor search#5
mboynes merged 24 commits intomasterfrom
search-refactor

Conversation

@mboynes
Copy link
Copy Markdown
Contributor

@mboynes mboynes commented Aug 10, 2014

This pull request completely refactors how search works. The overarching goal of the refactoring was to separate SP_Search into more specific features. Search was initially tied to, and depended on, the main query. SP_Search handled this auto-integration, but then provided methods for using ES args or WP-style args for doing additional searches. While handy, these were bound to the main singleton, which didn't make much sense. This update separates these three distinct features into their own classes:

  • SP_Search, which is the main class for performing a search with Elasticsearch, using the ES Query DSL
  • SP_WP_Search, which extends SP_Search to add support for wp-style arguments
  • SP_Integration, which replaces core's search with SearchPress (and uses SP_WP_Search to perform the query)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd like to know what that is a hash of. Hopefully something funny.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is something funny, but tbh I forgot what it is!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apparently it's "cucumber", or it least has a collision with it ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👏 Hah, you're absolutely right! It's a part of the SearchPress trivia game; "cucumber" was the first search ever performed on a site using SearchPress.

@bcampeau
Copy link
Copy Markdown
Member

Other than the one note and despite you not remembering the origin of the hash, this receives a 🐴

mboynes added a commit that referenced this pull request Aug 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants