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

Integration of search context #781

Merged
merged 7 commits into from
Mar 5, 2018

Conversation

romainruaud
Copy link
Collaborator

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

@romainruaud
Copy link
Collaborator Author

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

Copy link
Contributor

@afoucret afoucret left a 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);
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

@afoucret afoucret Mar 1, 2018

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 ?

@romainruaud romainruaud force-pushed the feature_search-context branch from 25e3b46 to ba90fc2 Compare March 2, 2018 15:06
@romainruaud
Copy link
Collaborator Author

I updated the PR (and also rebased it) to take your requests into account.

Let me know your advices.

regards

@afoucret
Copy link
Contributor

afoucret commented Mar 2, 2018

Test are still broken !!!

@romainruaud
Copy link
Collaborator Author

tests fixed !

@afoucret afoucret merged commit dbd863b into Smile-SA:master Mar 5, 2018
@romainruaud romainruaud deleted the feature_search-context branch March 15, 2018 11:09
Asfolny pushed a commit to storefront-bvba/elasticsuite-magento2 that referenced this pull request Apr 19, 2018
* Integration of search context and refactoring the way visibility and stock filter are applied.
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.

2 participants