Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESQL: Load keyword fields missing doc_values #98639

Merged
merged 2 commits into from
Aug 20, 2023

Conversation

csoulios
Copy link
Contributor

This PR adds support for loading keyword fields having doc_values: false in their mapping.

The code follows the same code path as when loading text fields, loading field from the index (if stored is true) or extracting from the _source.

@csoulios csoulios requested a review from nik9000 August 18, 2023 14:48
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Aug 18, 2023
@csoulios csoulios added :Analytics/ES|QL AKA ESQL and removed needs:triage Requires assignment of a team area label labels Aug 18, 2023
@elasticsearchmachine elasticsearchmachine added the Team:QL (Deprecated) Meta label for query languages team label Aug 18, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/elasticsearch-esql (:Query Languages/ES|QL)

// for the field type name to avoid adding a dependency to the module
if (fieldType instanceof KeywordFieldMapper.KeywordFieldType
|| fieldType instanceof TextFieldMapper.TextFieldType
|| "match_only_text".equals(fieldType.typeName())) {
Copy link
Member

Choose a reason for hiding this comment

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

Could be extracted into a constant.

Copy link
Member

Choose a reason for hiding this comment

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

I'd left a comment on the other copy of this about how it'd be lovely if this could go backwards, with the mappers defining this behavior. But that's not worth the extra complexity now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have thought about it too. Probably, the least invasive way to implement it in the field mappers is to add a new MappedFieldType.FielddataOperation.ESQL and use that in the MappedFieldType.fielddataBuilder() to define the behavior we need. I can give it a try in a following PR

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM

@csoulios csoulios merged commit c331d92 into elastic:main Aug 20, 2023
@csoulios csoulios deleted the no-kw-doc_values branch August 20, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >non-issue Team:QL (Deprecated) Meta label for query languages team v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants