Using filters against parent object in nested facet

Hello everybody.

I've been working with nested objects and I hit an issue. I can't use a
filter that applies to a parent object from the nested facet.

Mapping for my structure looks like this:

{
"mappings" : {
"Item" : {
"dynamic" : false,
"properties" : {
"categories" : {
"type" : "nested",
"properties" : {
"type" : {
"type" : "string",
"index" : "not_analyzed"
},
"name" : {
"type" : "string",
"index" : "not_analyzed"
}
}
},
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"name" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}

And the query that is in fact working looks like this one:

{
"query" : {
"match_all" : {}
},
"facets" : {
"my_facet" : {
"nested" : "categories",
"terms" : { "field" : "categories.name" },
"facet_filter" : {
"term" : { "categories.type" : "type1" }
}
}
}
}

But I've been trying to add a additional filter for the nested facet that
limits the parent objects.
It would look something like:

{
"query" : {
"match_all" : {}
},
"facets" : {
"my_facet" : {
"nested" : "categories",
"terms" : { "field" : "categories.name" },
"facet_filter" : {
"and" : [
{ "term" : { "categories.type" : "type1" } },
{ "prefix" : { "id" : "i" } }
]
}
}
}
}

But that prefix filter won't work for the parent object. Is there a way to
add a filter that applies to a parent object from a nested facet? If no,
then is there any fine workaround?
I'm using ES 0.90.0.Beta1.

Thanks in advance.

Paweł

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

But I've been trying to add a additional filter for the nested facet
that limits the parent objects.
It would look something like:

{
"query" : {
"match_all" : {}
},
"facets" : {
"my_facet" : {
"nested" : "categories",
"terms" : { "field" : "categories.name" },
"facet_filter" : {
"and" : [
{ "term" : { "categories.type" : "type1" } },
{ "prefix" : { "id" : "i" } }
]
}
}
}
}

But that prefix filter won't work for the parent object. Is there a
way to add a filter that applies to a parent object from a nested
facet? If no, then is there any fine workaround?
I'm using ES 0.90.0.Beta1.

Yeah. This is not currently supported. However, I'm pretty sure it
could be supported with some major facet refactoring.

Please open an issue for this

ta

clint

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Are there any plans to support this? Is there any ticket to track? I can't
find one.

Patryk

W dniu czwartek, 14 marca 2013 12:26:25 UTC+1 użytkownik Clinton Gormley
napisał:

But I've been trying to add a additional filter for the nested facet
that limits the parent objects.
It would look something like:

{
"query" : {
"match_all" : {}
},
"facets" : {
"my_facet" : {
"nested" : "categories",
"terms" : { "field" : "categories.name" },
"facet_filter" : {
"and" : [
{ "term" : { "categories.type" : "type1" } },
{ "prefix" : { "id" : "i" } }
]
}
}
}
}

But that prefix filter won't work for the parent object. Is there a
way to add a filter that applies to a parent object from a nested
facet? If no, then is there any fine workaround?
I'm using ES 0.90.0.Beta1.

Yeah. This is not currently supported. However, I'm pretty sure it
could be supported with some major facet refactoring.

Please open an issue for this

ta

clint

--
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.
For more options, visit https://groups.google.com/groups/opt_out.