Optimize OpenSearch Index by Indexing Only Static Metadata Fields #226
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces an optimization to our OpenSearch indexing process by ensuring that only static metadata fields are indexed. This change aims to improve search performance, reduce storage requirements, and streamline the indexing process by excluding dynamic fields that do not contribute to search relevancy.
Background
Previously, our OpenSearch index included both static and dynamic metadata fields. Dynamic fields, while useful for data representation, do not play a significant role in search queries. Indexing these fields unnecessarily increases the index size and impacts search performance.
Changes
Modified the OpenSearch mapping configuration to set dynamic to false for the metadata object. This prevents automatic indexing of any new fields not explicitly defined in the mapping.
Additional Steps
Recreate OpenSearch Index: The OpenSearch index must be recreated to apply the changes effectively.