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

feat: extend listSearchableFields relationship fields to include subfields #10693

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DanRibbens
Copy link
Contributor

@DanRibbens DanRibbens commented Jan 21, 2025

When adding relationships to admin.listSearchableFields the search feature doesn't effectively query the relationship field.

This change appends the relationship field name with the id, useAsTitle or admin.listSearchableFields to the relationship's collection in dot notation to support querying the related relationships data to give better search results.

Before admin.listSearchableFields:

[
  'id',
  'title',
  'description',
  'number',
  'relationship', // relationship to self
  'upload' // upload field
]

After sanitization:

[
  'id',
  'title',
  'description',
  'number',
  'relationship.id',
  'relationship.title',
  'relationship.description',
  'relationship.number',
  'relationship.relationship',
  'relationship.upload',
  'upload.filename'
]

Fixes # #10649

TODO:
For some reason the change is resulting in much more results than expected. There might be a bug with querying these relationships.
image

@tobiasiv
Copy link

Hey @DanRibbens, will "deep" searching and filtering be supported for join fields as well?

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

Successfully merging this pull request may close these issues.

2 participants