Provide a sane default normalizer for entities

Created on 3 May 2017, over 7 years ago
Updated 26 April 2024, 8 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.71.5 2024