Skip to content

$root keyword problem #13

@SergeyKokichev

Description

@SergeyKokichev

Hello, I'm having an issue with using the $root keyword. Here is my code:
var source = { "data": { "items": [ {"item": "one"}, {"item": "two"} ] } }

var template = { "query": { path: "data.items", nested: { "item": { path: "$item" } } } }

As a mapping result I will get this:
{ "query": [{ "term":{"item":"one} }, { "term":{"item":"two"} }] }

But when I change in the template 'path: "data.items"' to 'path: "$root.data.items"', I will get this:
{ "query": { "term": [ {"term":{"item":"one}}, {"term":{"item":"two"}} ] } }

So there is a strange behavior of the $root keyword.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions