Closed Jonesus closed 3 years ago
Adds a new option to flatten data before indexing, for easier handling of nested objects, for example translated data.
Flattens the Directus data keys to dot notation, for example:
{ name: 'helga', profession: { id: 1, title: 'driver' }, translations: [ { lang: 'en', title: 'driver' }, { lang: 'fr', title: 'chauffeur' } ], }
Transforms into
{ name: 'helga', profession.id: 1, profession.title: 'driver', translations.0.lang: 'en', translations.0.title: 'driver', translations.1.lang: 'fr', translations.1.title: 'chauffeur', }
It's a bit awkward for arrays but it works and it's reasonably painless to parse the search results back into a similar object that was in Directus
This branch is based on the RC update branch (https://github.com/dimitrov-adrian/directus-extension-searchsync/pull/1), so there's an extra commit before the main contents of this pr :)
Adds a new option to flatten data before indexing, for easier handling of nested objects, for example translated data.
Flattens the Directus data keys to dot notation, for example:
Transforms into
It's a bit awkward for arrays but it works and it's reasonably painless to parse the search results back into a similar object that was in Directus
This branch is based on the RC update branch (https://github.com/dimitrov-adrian/directus-extension-searchsync/pull/1), so there's an extra commit before the main contents of this pr :)