Skip to content

New field mapping flag - allow_multiple_values#80289

Closed
markharwood wants to merge 6 commits intoelastic:masterfrom
markharwood:fix/58523
Closed

New field mapping flag - allow_multiple_values#80289
markharwood wants to merge 6 commits intoelastic:masterfrom
markharwood:fix/58523

Conversation

@markharwood
Copy link
Copy Markdown
Contributor

@markharwood markharwood commented Nov 3, 2021

When set to false documents that present arrays instead of single values are rejected at ingest time.
TODO - docs

Closes #58523

@weizijun
Copy link
Copy Markdown
Contributor

weizijun commented Dec 6, 2021

@markharwood will the feature to be merged soon?

@markharwood
Copy link
Copy Markdown
Contributor Author

will the feature to be merged soon?

We're gathering interest in this change. While there are advantages to this feature there have been some reservations which are:

  • this could be the start of a "slippery slope" to taking care of all validation e.g. supporting enums which is something we don't want to do.
  • For use cases like observability, users would rather index and live with messy data than reject any documents

Can you say anything about your interest in this feature?

@markharwood markharwood added :Search Foundations/Mapping Index mappings, including merging and defining field types :Search/Search Search-related issues that do not fall into other categories labels Dec 6, 2021
@elasticmachine elasticmachine added Team:Search Meta label for search team labels Dec 6, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (Team:Search)

1 similar comment
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search (Team:Search)

@markharwood markharwood added >enhancement and removed :Search/Search Search-related issues that do not fall into other categories labels Dec 6, 2021
@weizijun
Copy link
Copy Markdown
Contributor

weizijun commented Dec 6, 2021

will the feature to be merged soon?

We're gathering interest in this change. While there are advantages to this feature there have been some reservations which are:

  • this could be the start of a "slippery slope" to taking care of all validation e.g. supporting enums which is something we don't want to do.
  • For use cases like observability, users would rather index and live with messy data than reject any documents

Can you say anything about your interest in this feature?

about this PR: #80685, I also add a single value parameter, when your PR merged, I will change my logic. It can resolve aggregate_metric_double performance problem.

When false documents that presents arrays instead of single values are rejected.
…or fields geo point/shape, histogram, dense_vector text and join.

At some point some of these fields may later offer user control over `allow_multiple_values` but is complicated in that some of them take arrays for the single value eg. a point or vector.
What we’d have to control is that arrays are accepted bu arrays of arrays are not. That’s more than enough complexity for one PR so for now we reject the allow_multiple_values setting.
@javanna
Copy link
Copy Markdown
Contributor

javanna commented May 30, 2022

This PR was never completed, closing.

@javanna javanna closed this May 30, 2022
@ebuildy
Copy link
Copy Markdown
Contributor

ebuildy commented Oct 5, 2022

My 2 cents, we use elasticsearch as data store with Apache Spark as data engine (with Kafka / S3 parquet files).

This work like a charm, but we miss a real data integrity with elasticsearch, anyone can add a bad document with an array instead of a concrete string, the document will be accepted but will break all our data pipeline (also there is no way to find the bad document ....).

I think "validation" is a good thing, we can put data on elasticsearch with so many ways:

  • bulk / index API
  • spark jobs
  • transformation
  • snapshot restore
  • update by query

It's always a good thing to have guarantee about what the data is. Also, there is a big gap between validation about what the data is (concrete or array), and enum.

As reference: https://discuss.elastic.co/t/mapping-how-to-disable-array-of-string/315782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'singleton' flag to field mappers?

9 participants