"Inherits" parents properties (hierarchy)

Hello,

I'm quite a newbie in ES world so please forgive me if I write something
stupid.

I have data organized in a hierarchical way:
.
-- [id=1 title="build a car" release="1.0"]-- [id=2 title="find the wheels" ]

When users look for "1.0" and "wheels" the should get document n°2
I tried to use the "parent" relationship (when I create document n°2, I
tell ES that document 1 is it's parent) but I get no results when I
querying like
{
"query": {
"bool": {
"must": [
{
"term": {
"release": "1.0"
}
},
{
"term": {
"title": "wheels"
}
}
]
}
}
}

How can I solve my problem ?

Thanks,
Manuel

--

I think that nested docs fits better to your use case. See:
Elasticsearch Platform — Find real-time answers at scale | Elastic
http://www.elasticsearch.org/guide/reference/mapping/nested-type.html

Have a look also at
Elasticsearch Platform — Find real-time answers at scale | Elastic
http://www.elasticsearch.org/guide/reference/query-dsl/has-child-query.html
and
Elasticsearch Platform — Find real-time answers at scale | Elastic
http://www.elasticsearch.org/guide/reference/query-dsl/has-parent-query.html

I think (not sure) it can help here.

My 2 cents

David.

Le 9 octobre 2012 à 15:45, Manuel Vacelet manuel.vacelet@gmail.com a écrit :

Hello,

I'm quite a newbie in ES world so please forgive me if I write something
stupid.

I have data organized in a hierarchical way:
.
-- [id=1 title="build a car" release="1.0"] -- [id=2 title="find the wheels" ]

When users look for "1.0" and "wheels" the should get document n°2
I tried to use the "parent" relationship (when I create document n°2, I tell
ES that document 1 is it's parent) but I get no results when I querying like
{
"query": {
"bool": {
"must": [
{
"term": {
"release": "1.0"
}
},
{
"term": {
"title": " wheels"
}
}
]
}
}
}

How can I solve my problem ?

Thanks,
Manuel

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--