Skip to content

fix(search): exclude polymorphic relations from extended search and fix missing JOIN on list#277

Merged
matthv merged 2 commits intomainfrom
fix/search-extended-poly
Mar 17, 2026
Merged

fix(search): exclude polymorphic relations from extended search and fix missing JOIN on list#277
matthv merged 2 commits intomainfrom
fix/search-extended-poly

Conversation

@matthv
Copy link
Member

@matthv matthv commented Mar 17, 2026

Exclude polymorphic relations from extended search and fix missing JOIN on list queries

  • SearchCollectionDecorator.get_fields now skips PolymorphicManyToOne and PolymorphicOneToOne relations during extended search, logging a debug message instead of traversing them.
  • Query.add_join_relation replaces includes with left_joins so filtering/sorting on related fields uses a LEFT OUTER JOIN rather than eager loading.
  • Query.query_aggregator now preserves both includes_values and left_outer_joins_values when composing queries without an initial where clause, preventing loss of join context.
  • Behavioral Change: list queries that filter or sort on relation fields will now emit a JOIN instead of triggering eager loading, which changes query structure and may affect performance on large datasets.

Macroscope summarized 02d459a.

Copy link
Member

@arnaud-moncel arnaud-moncel left a comment

Choose a reason for hiding this comment

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

🚀

@matthv matthv merged commit 0081a83 into main Mar 17, 2026
36 checks passed
@matthv matthv deleted the fix/search-extended-poly branch March 17, 2026 15:41
forest-bot added a commit that referenced this pull request Mar 17, 2026
## [1.25.3](v1.25.2...v1.25.3) (2026-03-17)

### Bug Fixes

* **search:** exclude polymorphic relations from extended search and fix missing JOIN on list ([#277](#277)) ([0081a83](0081a83))
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.25.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants