Skip to content

Conversation

@romseygeek
Copy link
Contributor

In preparation for doc-value skippers being enabled in some keyword
field types, TermBasedFieldType should take IndexType directly in its
constructor rather than booleans for indexed and docvalues.

In preparation for doc-value skippers being enabled in some keyword
field types, TermBasedFieldType should take IndexType directly in
its constructor rather than booleans for indexed and docvalues.
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

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

LGTM, just an optional suggestion.

KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate
) {
super(name, true, false, false, tsi, meta, isSyntheticSource, withinMultiField);
super(name, IndexType.terms(true, false), false, tsi, meta, isSyntheticSource, withinMultiField);
Copy link
Member

Choose a reason for hiding this comment

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

IndexType.terms(true, false) appears 14 times in this PR and exists in 4 more places in the existing code. What do you think about adding IndexType.termsOnly() to make it a bit more expressive? We could even return an internal constant IndexType instead of creating an equal instance very time IndexType.termsOnly() is called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, having agreed - I'm considering moving the stored field into IndexType as well, given that it's another lucene data structure, which I think would make the suggested change less useful. So I think I will leave it for a follow up investigation.


public ParentIdFieldType(String name, boolean eagerGlobalOrdinals) {
super(name, true, false, true, TextSearchInfo.SIMPLE_MATCH_ONLY, Collections.emptyMap());
super(name, IndexType.terms(true, true), false, TextSearchInfo.SIMPLE_MATCH_ONLY, Collections.emptyMap());
Copy link
Member

Choose a reason for hiding this comment

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

Similar story here. Maybe replace IndexType.terms(true, true) with IndexType.termsAndDocValues()

@romseygeek romseygeek merged commit acf0e4d into elastic:main Nov 12, 2025
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants