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

Neg. operators (neq,sneq,nin) support in filter query builder (addFieldToFilter) #371

Merged
merged 1 commit into from
Oct 25, 2018

Conversation

rbayet
Copy link
Collaborator

@rbayet rbayet commented Mar 26, 2017

Based on 2.3.x code, a quick-and-dirty solution to support ->addFieldToFilter operators "neq", "sneq" and "nin" in the filter query builder, by simpling negating the terms query generated.

Allows a range of functional negative filters on the product collection: exclude some products by their id, filter out some attribute sets, product type, etc.

@romainruaud
Copy link
Collaborator

This one is mandatory for targetrules implementation : allow to exclude current product from the results.

@renttek
Copy link

renttek commented Jul 23, 2018

Hey @afoucret , whats the status of this PR? Is there still something to do?

I currently have a shop, where another extension (which is needed) uses "nin" filters for Categories and breaks autocompletion. The workaround was to remove the categories from the auto completion, but I need this feature in the future.

If there is anything I can do (coding, testing, etc.) I'd like to help finish this PR

@renttek
Copy link

renttek commented Aug 15, 2018

/cc @romainruaud

ping?

@romainruaud romainruaud changed the base branch from 2.3.x to 2.6.x October 11, 2018 08:49
@romainruaud romainruaud assigned rbayet and unassigned afoucret Oct 11, 2018
@romainruaud
Copy link
Collaborator

@rbayet can you check this PR is still OK for a potential merge on 2.6.x ? According to the Github GUI, it should, but can you also test it by your side ?

Regards

@rbayet rbayet force-pushed the addfieldtofilter_negative_op branch from 151044c to 7d9ffc7 Compare October 16, 2018 10:30
@rbayet
Copy link
Collaborator Author

rbayet commented Oct 16, 2018

@romainruaud the PR was no longer OK for a merge on 2.6.x (some conflicting changes in \Smile\ElasticsuiteCore\Search\Request\Query\Filter\QueryBuilder).

I rebased on 2.6.x and quickly tested in \Smile\ElasticsuiteVirtualCategory\Model\Preview::prepareProductCollection but trying to find a way to fully test fulltext search navigation.

@rbayet rbayet changed the title Neg. operators (neq,sneq,nin) support in filter query builder (addFieldToFilter) WIP: Neg. operators (neq,sneq,nin) support in filter query builder (addFieldToFilter) Oct 16, 2018
@rbayet rbayet force-pushed the addfieldtofilter_negative_op branch from 7d9ffc7 to 6f7e442 Compare October 16, 2018 12:44
@rbayet rbayet changed the title WIP: Neg. operators (neq,sneq,nin) support in filter query builder (addFieldToFilter) Neg. operators (neq,sneq,nin) support in filter query builder (addFieldToFilter) Oct 16, 2018
@rbayet rbayet requested a review from romainruaud October 16, 2018 12:53
@rbayet
Copy link
Collaborator Author

rbayet commented Oct 16, 2018

Tested from \Smile\ElasticsuiteCatalog\Plugin\LayerPlugin::setSortParams in catalognavigation.
Altered the unit test on unsupported conditions (because "neq" is now supported).

@rbayet rbayet assigned romainruaud and unassigned rbayet Oct 16, 2018
@romainruaud romainruaud merged commit 5af3e1d into Smile-SA:2.6.x Oct 25, 2018
@rbayet rbayet deleted the addfieldtofilter_negative_op branch December 11, 2018 10:11
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.

4 participants