Skip to content

Field resolution should be unambiguous #4081

Closed
@clintongormley

Description

@clintongormley

As far as I understand it, fields are resolved on a first found basis. So given the following documents:

PUT /index/foo/1
{
    "count": 1,
    "foo": {
        "count": 1
    }
}

PUT /index/bar/2
{
    "count": 1,
    "foo": {
        "count": 1
    }
}

.... the field foo.count could resolve to foo.count, foo.foo.count, or bar.foo.count, depending on which is found first.

Field resolution should be unambiguous. Field names should be grouped by type and sorted in descending order by number of .. So the above mappings should result in:

bar:
    foo.count
    count

foo:
   foo.count
   count

Then if no type is specified (or multiple types are specified), go through the groups in alphabetical order.

This would result in the following resolutions:

foo.foo.count   => (foo) foo.count
foo.count       => (foo) count
count           => (bar) count
*.foo.count     => (bar) foo.count
*.count         => (bar) count
*.*.count       => (bar) foo.count

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions