i have a given document:
{
"foo": {}
}
where foo
can have an arbitrary amount of properties. lets assume i will
import millions of documents into my index, in which each of foo
's
properties do have other values.
that means my mapping which will be built dynamically will grow enormous.
is there any kind of way where i can tell elasticsearch something like
take everything you have in foo
and just accept it as it is (or
stringify foo
) without having a resulting million-lines-mapping???
or do i have to care by myself, before indexing documents?
if so, there a 2 solutions i think
- JSON-Stringify
JSON.stringify(obj.foo)
- map every property in
foo
into key/value pairs, and create an array of
objects:
// object
{
"foo": [
{"key": "bar1", "value": "bar1's value"},
{"key": "bar2", "value": "bar2's value"}
]
}
// resulting mapping
{
"type": {
"properties": {
"foo": {
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
would you prefer then solution 1 or 2, and why?
appreciate your help!
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1207c3c0-3fba-4b6e-9cfc-b501afca1614%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.