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

Painless - handle equivalent paths in write fields API #91142

Open
stu-elastic opened this issue Oct 26, 2022 · 1 comment
Open

Painless - handle equivalent paths in write fields API #91142

stu-elastic opened this issue Oct 26, 2022 · 1 comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team

Comments

@stu-elastic
Copy link
Contributor

In write contexts, the fields API should access equivalent paths without the caller needing to know their structure in the source. If there are multiple paths that map to the same field address, they should be merged.

For example:

{
  "a": {"b": {"c": 1 }, "b.c": 2 },
  "a.b.c": 3
}

$('a.b.c', null) returns [1,2,3].

Some complications are:

  • External containers, eg Map a = new HashMap(); ctx['a'] = a; a['foo'] = bar;
  • Mulihoming, eg ctx['b'] = ctx['a'];
  • Cycles, eg ctx['a']['b'] = ctx['a'];

Refs: #79155

@stu-elastic stu-elastic added >enhancement :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache labels Oct 26, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Oct 26, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

stu-elastic added a commit to stu-elastic/elasticsearch that referenced this issue Feb 22, 2023
Implementations of functional interface `XContentTypeExtractor` can
return a java type not natively supported by existing `XContentParser`s.

Refactor some `convertToMap` calls to use method refs to
`XContentParser.map` and `mapOrdered` using the new `parseToType` method.

Refs: elastic#91142
stu-elastic added a commit that referenced this issue Feb 27, 2023
* Support wrapping XContentParser to extract a non-map type.

Implementations of functional interface `XContentTypeExtractor` can
return a java type not natively supported by existing `XContentParser`s.

Refactor some `convertToMap` calls to use method refs to
`XContentParser.map` and `mapOrdered` using the new `parseToType` method.

Refs: #91142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

2 participants