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

Add NotInCondition Filter #448

Merged
merged 14 commits into from
Oct 16, 2024

Conversation

ToshY
Copy link
Contributor

@ToshY ToshY commented Oct 15, 2024

This add supports for NotInCondition with the already support for AndCondition and NotEqualCondition it should be possible to implement a NotInCondition in all adapters as NOT IN is just a shortcut for NotEqualCondition on the same field AND connected.

So instead of writing:

new Condition\AndCondition(
    new Condition\NotEqualCondition('tags', 'UI'),
    new Condition\NotEqualCondition('tags', 'UX'),
    new Condition\NotEqualCondition('tags', 'Frontend'),
);

It should now be possible to write:

new Condition\NotInCondition('tags', ['UI','UX','Frontend'])

Fixes #445

Todo

  • Core: Add NotInCondition
  • Memory
  • Elasticsearch
  • Opensearch
  • Meilisearch
  • Algolia
  • Loupe
  • Redisearch
  • Solr
  • Typesense

@ToshY ToshY marked this pull request as ready for review October 15, 2024 21:02
@ToshY
Copy link
Contributor Author

ToshY commented Oct 15, 2024

@alexander-schranz I'm not sure why some tests fail sometimes in CI. I have run the tests locally with docker for the following adapters: meilisearch, elasticsearch, memory and solr, and they were ok.

@alexander-schranz
Copy link
Member

@ToshY there is currently an issue with the checkout process going on the false commit hash. You can retrigger the CI with additional commit push git commit --allow-empty -m "Update base branch"

@alexander-schranz alexander-schranz added features New feature or request Adapter: Elasticsearch Elasticsearch Adapter releated issue Adapter: Opensearch Opensearch Adapter related issue Adapter: Memory Memory Adapter related issue Adapter: Meilisearch Meilisearch Adapter related issue SEAL Core Seal Core related issue Adapter: Algolia Algolia Adapter related issue Adapter: Solr Solr Adapter related issue Adapter: Typesense Typesense Adapter related issue Adapter: RediSearch RediSearch Adapter related issue Adapter: Loupe Loupe Adapter related issue labels Oct 16, 2024
@alexander-schranz alexander-schranz force-pushed the feature/445-not-in-condition branch from 473768c to fd08574 Compare October 16, 2024 16:24
@alexander-schranz alexander-schranz added this to the 1.0.0 milestone Oct 16, 2024
@alexander-schranz
Copy link
Member

I adopted the test case the order for none "searches" can be differently by the search engines so the testcase just need to check if the expected documents exists not if they are in the same order. This way also the other adapters seems to work fine.

@alexander-schranz alexander-schranz merged commit a631d99 into PHP-CMSIG:0.6 Oct 16, 2024
30 of 32 checks passed
@alexander-schranz
Copy link
Member

@ToshY all green 🎉 . Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adapter: Algolia Algolia Adapter related issue Adapter: Elasticsearch Elasticsearch Adapter releated issue Adapter: Loupe Loupe Adapter related issue Adapter: Meilisearch Meilisearch Adapter related issue Adapter: Memory Memory Adapter related issue Adapter: Opensearch Opensearch Adapter related issue Adapter: RediSearch RediSearch Adapter related issue Adapter: Solr Solr Adapter related issue Adapter: Typesense Typesense Adapter related issue features New feature or request SEAL Core Seal Core related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] Add support for NotInCondition
2 participants