Skip to content

Implement "OR filter relationships" in DateQuery - #4165

Merged
felipeelia merged 9 commits into
developfrom
fix/4076
Jul 22, 2025
Merged

Implement "OR filter relationships" in DateQuery#4165
felipeelia merged 9 commits into
developfrom
fix/4076

Conversation

@burhandodhy

Copy link
Copy Markdown
Contributor

Description of the Change

This PR adds support for the relationship OR in Date Query.

Closes #4076

How to test the Change

Changelog Entry

Added - Implement "OR filter relationships" in DateQuery

Credits

Props @burhandodhy @eartahhj

Checklist:

@burhandodhy
burhandodhy requested review from Copilot and removed request for Copilot June 17, 2025 13:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements support for "OR filter relationships" within the DateQuery functionality, enabling date queries to combine conditions using a logical OR. Key changes include:

  • Adding test cases in TestPost.php to validate various OR-based date query scenarios.
  • Extending the parse_date method in Post.php to account for an "or" key.
  • Implementing the OR relation clause in DateQuery.php that builds appropriate Elasticsearch filters.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/php/indexables/TestPost.php New test cases validating OR relation behavior in date queries.
includes/classes/Indexable/Post/Post.php Updated parse_date to return value for an "or" filter, enabling OR logic.
includes/classes/Indexable/Post/DateQuery.php New OR relation branch added to build Elasticsearch "should" clauses.
Comments suppressed due to low confidence (1)

includes/classes/Indexable/Post/DateQuery.php:137

  • [nitpick] Consider adding a comment to explain the logic behind constructing the 'should' clauses for the OR relation. This documentation would clarify the intent and structure for future maintainers.
					],

Comment thread includes/classes/Indexable/Post/Post.php

@felipeelia felipeelia left a comment

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.

Can we add @since tags to the tests please, @burhandodhy ?

@felipeelia felipeelia added this to the 5.3.0 milestone Jun 24, 2025
@felipeelia

Copy link
Copy Markdown
Member

@burhandodhy can you please fix this git conflict so we can merge this one? Thanks!

@felipeelia
felipeelia merged commit d3bbb2c into develop Jul 22, 2025
20 of 24 checks passed
@felipeelia
felipeelia deleted the fix/4076 branch July 22, 2025 11:43
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.

Implementing "OR filter relationships" in DateQuery.php

3 participants