-
Notifications
You must be signed in to change notification settings - Fork 340
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
Integration of search context #781
Conversation
ed39882
to
c4fa81c
Compare
I updated the PR as we said yesterday (rename DefaultFilter to Filter, load the filters from XML files, and let the Container build the filter queries from the current search context). Let me know if it suits you best this way. For now the Context is still "immutable", I wait for your thought about this point too. Regards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some modification for the search context to be implemented
* | ||
* @return \Smile\ElasticsuiteCore\Search\Request\QueryInterface[] | ||
*/ | ||
public function getFilters(\Smile\ElasticsuiteCore\Search\Context $searchContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\Smile\ElasticsuiteCore\Search\Context should be an interface as it is used in the API area.
* @package Smile\ElasticsuiteCore | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
*/ | ||
class Context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implemented method are OK but I want to be able to write arbitrary data in the context.
Maybe add customer_group by default in the context.
* @package Smile\ElasticsuiteCatalog | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
*/ | ||
class Visibility implements FilterInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad logic.
You should not have an if but 2 classes instead.
The visibility is not defined by having or not a category or a search query but by the container itself.
What happen if someone set the category in the search context while we are using the fulltext search container ?
…guration build query filters according to current search context.
…plit the Visibility filter into two different implementations.
25e3b46
to
ba90fc2
Compare
I updated the PR (and also rebased it) to take your requests into account. Let me know your advices. regards |
Test are still broken !!! |
tests fixed ! |
* Integration of search context and refactoring the way visibility and stock filter are applied.
This PR contains a first version of the SearchContext integration.
I also added default Visibility/Stock filter to ensure it is working as intended.
It actually works without breaking anything. Filters are only applied in frontend for now, and most of time duplicate already existing ones.
Let me know if the architecture seems ok for you now, and then I'll be able to process additional cleaning and update this PR (or create a new one).
Regards