Skip to content

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