Skip to content

Conversation

@bharath-techie
Copy link
Contributor

Description

This PR adds support for composite indices with custom codecs.
We delegate to the CompositeCodec instead of always delegating to PerFieldMappingPostingFormatCodec based on whether mapper has Composite fields.

Related Issues

Resolves #209

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Lucene101CustomStoredFieldsFormat storedFieldsFormat = (Lucene101CustomStoredFieldsFormat) codec.storedFieldsFormat();
assertEquals(DEFAULT_COMPRESSION_LEVEL, storedFieldsFormat.getCompressionLevel());
// assert docValues to be of compositeCodec's docValuesFormat
assert codec.docValuesFormat() instanceof Composite912DocValuesFormat;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filter codec does not expose delegate, so could not find a better way for assertion.

@bharath-techie bharath-techie requested a review from mgodwan July 7, 2025 10:52
@bharath-techie
Copy link
Contributor Author

Hi @reta @sarthakaggarwal97 @andrross @mgodwan ,
Can somebody please review this PR ?

Signed-off-by: bharath-techie <[email protected]>
Signed-off-by: bharath-techie <[email protected]>
int compressionLevel = indexSettings.getValue(INDEX_CODEC_COMPRESSION_LEVEL_SETTING);
final MapBuilder<String, Codec> codecs = MapBuilder.<String, Codec>newMapBuilder();
// Delegate to OpenSearch "default" codec
Supplier<Codec> defaultCodecSupplier = () -> super.defaultCodec();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you don't need defaultCodecSupplier anymore, just use this::defaultCodec

bharath-techie and others added 2 commits July 10, 2025 16:12
Signed-off-by: bharath-techie <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
@reta reta merged commit 4e6621b into opensearch-project:main Jul 11, 2025
8 checks passed
Copy link
Collaborator

@sarthakaggarwal97 sarthakaggarwal97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

[FEATURE] Support for composite codec

3 participants