I've got documents with nested objects.
(i'm using ElasticSearch 0.90.2)
I would like to have term facets on these objects (I know how to do it).
Now, I would like to filter this facet on a field that belongs to the root
object, not to the nested object.
I've created a gist with my test (mapping, data & request) :
Without the filter, the term facet contains all terms (FOO, BAR, BAZ) :
I've got documents with nested objects.
(i'm using ElasticSearch 0.90.2)
I would like to have term facets on these objects (I know how to do it).
Now, I would like to filter this facet on a field that belongs to the root object, not to the nested object.
I've created a gist with my test (mapping, data & request) :
Without the filter, the term facet contains all terms (FOO, BAR, BAZ) :
{
"query": {
"match_all": {}
},
"facets": {
"facet_situations": {
"global": true,
"nested": "situations",
"terms": {
"field": "situations.type"
}
}
}
}
With the term filter, the facet is empty
{
"query": {
"match_all": {}
},
"facets": {
"facet_situations": {
"global": true,
"nested": "situations",
"terms": {
"field": "situations.type"
},
"facet_filter": {
"term": {
"record.reference": "RECORD-2"
}
}
}
}
}
Is it possible to filter the facet with root object fields ?
if it's possible to put the FilteredQuery in the facet_filter, yes, it
could work.
(do you have an example ?)
If you meant use a FilteredQuery instead of matchall, it could not work
for me : in my app, I need to have facets that have different filters from
main query.
Damien
Le lundi 12 août 2013 22:01:05 UTC+2, David Pilato a écrit :
Does a FilteredQuery could work for you?
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 12 août 2013 à 21:52, Damien Ferey <damien...@gmail.com <javascript:>>
a écrit :
Hello,
I've got documents with nested objects.
(i'm using Elasticsearch 0.90.2)
I would like to have term facets on these objects (I know how to do it).
Now, I would like to filter this facet on a field that belongs to the root
object, not to the nested object.
Is it possible to filter the facet with root object fields ?
--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
if it's possible to put the FilteredQuery in the facet_filter, yes, it could work.
(do you have an example ?)
If you meant use a FilteredQuery instead of matchall, it could not work for me : in my app, I need to have facets that have different filters from main query.
Damien
Le lundi 12 août 2013 22:01:05 UTC+2, David Pilato a écrit :
Does a FilteredQuery could work for you?
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
I've got documents with nested objects.
(i'm using Elasticsearch 0.90.2)
I would like to have term facets on these objects (I know how to do it).
Now, I would like to filter this facet on a field that belongs to the root object, not to the nested object.
And if I swith to a parent/child model, is it possible to request facet on
children ?
(if not, I will give a try to multi search)
Le lundi 12 août 2013 23:24:13 UTC+2, David Pilato a écrit :
Sadly I meant the second option.
I don't know (yet) if there is another option.
If not, you can probably use multisearch API with Filtered Queries (in
place of matchAll).
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 12 août 2013 à 22:05, Damien Ferey <damien...@gmail.com <javascript:>>
a écrit :
if it's possible to put the FilteredQuery in the facet_filter, yes, it
could work.
(do you have an example ?)
If you meant use a FilteredQuery instead of matchall, it could not work
for me : in my app, I need to have facets that have different filters from
main query.
Damien
Le lundi 12 août 2013 22:01:05 UTC+2, David Pilato a écrit :
Does a FilteredQuery could work for you?
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
I've got documents with nested objects.
(i'm using Elasticsearch 0.90.2)
I would like to have term facets on these objects (I know how to do it).
Now, I would like to filter this facet on a field that belongs to the
root object, not to the nested object.
--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
if it's possible to put the FilteredQuery in the facet_filter, yes, it
could work.
(do you have an example ?)
If you meant use a FilteredQuery instead of matchall, it could not work
for me : in my app, I need to have facets that have different filters from
main query.
Damien
Le lundi 12 août 2013 22:01:05 UTC+2, David Pilato a écrit :
Does a FilteredQuery could work for you?
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
I've got documents with nested objects.
(i'm using Elasticsearch 0.90.2)
I would like to have term facets on these objects (I know how to do it).
Now, I would like to filter this facet on a field that belongs to the
root object, not to the nested object.
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.