In both types, I can also use "variation.size" to denote the field. So I
can use the notation "variation.size" to query this field, such as term
query:
The elasticsearch site has a short writeup about the benefits of the nested
type:
Basically, with object types, multiple instances of a field are flattened
as an unordered array. In your example, if you would not be possible to
search for an object that has a specific size and color since the query
could match on a parent object that contains an object child with the
desired size and another child with the color. Nested documents will allow
you to return only the parent documents that contain children matching all
the conditions.
In both types, I can also use "variation.size" to denote the field. So I
can use the notation "variation.size" to query this field, such as term
query:
Basically, with object types, multiple instances of a field are flattened
as an unordered array. In your example, if you would not be possible to
search for an object that has a specific size and color since the query
could match on a parent object that contains an object child with the
desired size and another child with the color. Nested documents will allow
you to return only the parent documents that contain children matching all
the conditions.
Cheers,
Another Ivan
On Wed, Jan 22, 2014 at 11:41 PM, Ivan Ji <hxu...@gmail.com <javascript:>>wrote:
Hi, all
I am wondering what the difference between the two types in the mappings.
I know the nested object can be query using nested query. but can the
object type field be query using other queries, such as term query?
ex, what's the difference when I change the type of "variation " to
object?
In both types, I can also use "variation.size" to denote the field. So I
can use the notation "variation.size" to query this field, such as term
query:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.