Skip to content

feat: add sortableAttributes for createdAt/updatedAt in Meilisearch indexes#12402

Open
mac-eochaidh wants to merge 2 commits intodanny-avila:mainfrom
mac-eochaidh:feat/meilisearch-sortable-attributes
Open

feat: add sortableAttributes for createdAt/updatedAt in Meilisearch indexes#12402
mac-eochaidh wants to merge 2 commits intodanny-avila:mainfrom
mac-eochaidh:feat/meilisearch-sortable-attributes

Conversation

@mac-eochaidh
Copy link
Copy Markdown

@mac-eochaidh mac-eochaidh commented Mar 25, 2026

Summary

Adds sortableAttributes configuration to MeiliSearch indexes for createdAt and updatedAt fields. This enables chronological sorting of conversations and messages in both ascending and descending order. The change includes comprehensive test coverage with unit tests for settings configuration verification and integration tests that validate sorting functionality.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Translation update

Testing

Unit tests and integration tests verify the sortableAttributes configuration.

Test Configuration:

cd packages/data-schemas
npx jest mongoMeili.spec.ts mongoMeili.integration.spec.ts

Tests include:

  • Unit tests verifying updateSettings is called with correct sortableAttributes and filterableAttributes
  • Integration tests validating sorting by createdAt/updatedAt in asc and desc directions
  • Tests confirming filterableAttributes (user) continues to work alongside sortableAttributes

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

@mac-eochaidh mac-eochaidh force-pushed the feat/meilisearch-sortable-attributes branch 2 times, most recently from 7a6a61f to 0b9dc7c Compare March 26, 2026 00:06
@mac-eochaidh mac-eochaidh marked this pull request as ready for review March 26, 2026 00:09
@mac-eochaidh mac-eochaidh changed the title feat: add sortableAttributes for createdAt/updatedAt in Meilisearch i… feat: add sortableAttributes for createdAt/updatedAt in Meilisearch indexes Mar 26, 2026
@mac-eochaidh mac-eochaidh force-pushed the feat/meilisearch-sortable-attributes branch 2 times, most recently from bb54f0f to a9940b7 Compare March 28, 2026 20:37
…ndexes

Adds sortableAttributes configuration to MeiliSearch indexes for createdAt and updatedAt fields. This enables chronological sorting of conversations and messages. Includes unit tests for settings configuration and integration tests for sorting in both directions.
@mac-eochaidh mac-eochaidh force-pushed the feat/meilisearch-sortable-attributes branch from a9940b7 to 19271a7 Compare March 28, 2026 21:18
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.

1 participant