Hiya
I'm using index_name and path in what feels like a hacky way, and just want to confirm that the way it works is intended, and won't change in the future.
I'm using a UID object to reference other objects stored in other types in ElasticSearch. That UID has an index, type and id attribute. I'd like to be able to access those as uid.index, uid.type etc, even thought the path may be:
{ employees: { managers: { uid: { index: 'foo' .....}}}}
I'm using a mapping like this:
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d '
{
"mappings" : {
"test" : {
"properties" : {
"baz" : {
"type" : "object",
"properties" : {
"foo" : {
"type" : "object",
"properties" : {
"uid" : {
"path" : "just_name",
"type" : "object",
"properties" : {
"index" : {
"index_name" : "uid.index",
"type" : "string"
}
}
}
}
}
}
}
}
}
}
}
'
Note the index_name: "uid.index" and path: "just_name".
This mapping makes these fields queryable:
- index
- uid.index
- baz.foo.uid.index
That suits my purposes, but I'd like to make sure that it isn't going to change :)
curl -XPUT 'http://127.0.0.1:9200/test/test/1?pretty=1' -d '
{
"baz" : {
"foo" : {
"uid" : {
"index" : "bar"
}
}
}
}
'
index = 1
curl -XGET 'http://127.0.0.1:9200/test/test/_count?pretty=1' -d '
{
"text" : {
"index" : "bar"
}
}
'
uid.index = 1
curl -XGET 'http://127.0.0.1:9200/test/test/_count?pretty=1' -d '
{
"text" : {
"uid.index" : "bar"
}
}
'
foo.uid.index = 0
curl -XGET 'http://127.0.0.1:9200/test/test/_count?pretty=1' -d '
{
"text" : {
"foo.uid.index" : "bar"
}
}
'
baz.foo.uid.index = 1
curl -XGET 'http://127.0.0.1:9200/test/test/_count?pretty=1' -d '
{
"text" : {
"baz.foo.uid.index" : "bar"
}
}
'
Hiya
I'm using
index_nameandpathin what feels like a hacky way, and just want to confirm that the way it works is intended, and won't change in the future.I'm using a
UIDobject to reference other objects stored in other types in ElasticSearch. ThatUIDhas anindex,typeandidattribute. I'd like to be able to access those asuid.index,uid.typeetc, even thought the path may be:I'm using a mapping like this:
Note the
index_name: "uid.index"andpath: "just_name".This mapping makes these fields queryable:
That suits my purposes, but I'd like to make sure that it isn't going to change :)
index = 1
uid.index = 1
foo.uid.index = 0
baz.foo.uid.index = 1