Having implemented the solution using enabled=false on a normal object
type - I find that my query time has increased massively, probably
because the queries I execute almost always access the "source"
object, which now has to deserialize additional very big objects.
From the Nested Object Documentation
"Those internal nested documents are automatically masked away when
doing operations against the index (like searching with a match_all
query), and they bubble out when using the nested query."
So, my idea is, to offer users the functionality to include this
object (using a checkbox option) by pushing the large HashMap into a
nested property where, as I understand it, nested objects are only de-
serialized if a query is made against them.
My Ideas is to define the mapping, as follows:
{
"MainType" : {
"properties" : {
"nestedObject" : {
"type" : "nested",
"properties" : {
"constantField" : {"type" : "string", "index" : "not_analyzed"},
"weekViewMap" : {"type" : "object", "enabled" : false}
}
}
}
}
}
So, I would "turn on" the weekView serialization, by making a Nested
TermFilter search, where nestedObject.contstantField="ALL-OBJECTS-HAVE-
THIS".
Questions
- Will this work?
- Will a query against another nested object also cause this nested
object to be included in the source, or do the different nested
objects act indepently?
On Nov 22, 8:34 am, Shay Banon kim...@gmail.com wrote:
You mean not index that big "hashmap"? You can map the object level
property of it with enabled set to false, which means it will not even go
and try and map the object represented by it.
On Mon, Nov 21, 2011 at 9:34 PM, davrob2 davirobe...@gmail.com wrote:
Hi,
I would like to store a large hashmap in my index without mapping it
but having available in the _source.
Essentially I want to use Elasticsearch as an object store, where I
can associate a hashmap with an index id rather than make a call out
to Mongo DB, and the like, using the id as a reference.
-David.