Provide a sane default normalizer for entities

Created on 3 May 2017, about 7 years ago
Updated 26 April 2024, 2 months ago

When using elasticsearch_helper with entities on a vanilla drupal right now, it will most likely use the ContentEntityNormalizer to serialize the entities, which will basically return something very close to $entity->toArray(). There's nothing wrong with that, but it's not particularily useful for use with elasticsearch either.

I hacked up a normalizer which main purpose is to provide a flat data structure. Besides entity type and id it add every field holding strings (fields based on StringItemBase and TextItemBase) and will resolve all entity reference fields to the label of the referenced entities.

It's certainly not perfect and is not meant to be, but I guess it's more welcoming for users of elasticsearch_helper to provide something somehow useful instead of an array of doomβ„’.

✨ Feature request
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany g.oechsler

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡±πŸ‡»Latvia maijs

    Elasticsearch Helper is designed to be a developers' helper tool, where developer has the full control over the indexing.

    For a more user friendly experience, see if Elasticseach Helper Content β†’ module is more suitable. It allows creating indices in UI, selecting specific fields with specific format.

Production build 0.69.0 2024