query_failed.js - this returns empty set because there is exists filter
in facet_filter that checks testobj.idtest which is not in nested object
(testobj.obj1).
So the question is: how to filter documents on any document fields (here:
testobj.idtest) using facets on field from nested object (here:
testobj.obj1.date)?
query_failed.js - this returns empty set because there is exists filter
in facet_filter that checks testobj.idtest which is not in nested object
(testobj.obj1).
So the question is: how to filter documents on any document fields (here:
testobj.idtest) using facets on field from nested object (here:
testobj.obj1.date)?
I don't see anything obviously wrong, but it is better to gist actual
curl statements that allow people to copy-and-paste in order to test
locally, otherwise, speaking for myself, I don't have the time
I have the following problem, please check
out https://gist.github.com/d3234db747e6e845d1e5
1. query_ok.js - executes OK and this is OK
2. query_failed.js - this returns empty set because there is
exists filter in facet_filter that checks testobj.idtest which
is not in nested object (testobj.obj1).
So the question is: how to filter documents on any document
fields (here: testobj.idtest) using facets on field from
nested object (here: testobj.obj1.date)?
Thanks.
Best regards
Marcin.
I don't see anything obviously wrong, but it is better to gist actual
curl statements that allow people to copy-and-paste in order to test
locally, otherwise, speaking for myself, I don't have the time
I have the following problem, please check
out https://gist.github.com/d3234db747e6e845d1e5
1. query_ok.js - executes OK and this is OK
2. query_failed.js - this returns empty set because there is
exists filter in facet_filter that checks testobj.idtest which
is not in nested object (testobj.obj1).
So the question is: how to filter documents on any document
fields (here: testobj.idtest) using facets on field from
nested object (here: testobj.obj1.date)?
Thanks.
Best regards
Marcin.
I don't see anything obviously wrong, but it is better to gist actual
curl statements that allow people to copy-and-paste in order to test
locally, otherwise, speaking for myself, I don't have the time
I have the following problem, please check
out https://gist.github.com/d3234db747e6e845d1e5
1. query_ok.js - executes OK and this is OK
2. query_failed.js - this returns empty set because there is
exists filter in facet_filter that checks testobj.idtest which
is not in nested object (testobj.obj1).
So the question is: how to filter documents on any document
fields (here: testobj.idtest) using facets on field from
nested object (here: testobj.obj1.date)?
Thanks.
Best regards
Marcin.
The problem is that your facet is running an a nested object:
"nested":"testobj.obj1",
which means that it can't see field testobj.idtest
To be clear, a nested object is a SEPARATE doc internally. So either,
you need to use the 'exists' filter as part of the query, or you can
configure your main object to also store a copy of the nested object
data:
Thank you for your help.
The one you gave does not work because testobj.obj1 is a nested object and
the date_histogram works with testobj.obj1.date field. It would work if the
facet didn't work with field of nested object.
So, any other ideas ? The question is if this is possible in ES
I don't see anything obviously wrong, but it is better to gist actual
curl statements that allow people to copy-and-paste in order to test
locally, otherwise, speaking for myself, I don't have the time
I have the following problem, please check
out https://gist.github.com/d3234db747e6e845d1e5
1. query_ok.js - executes OK and this is OK
2. query_failed.js - this returns empty set because there is
exists filter in facet_filter that checks testobj.idtest which
is not in nested object (testobj.obj1).
So the question is: how to filter documents on any document
fields (here: testobj.idtest) using facets on field from
nested object (here: testobj.obj1.date)?
Thanks.
Best regards
Marcin.
I was afraid that these were the only one solutions. I did it the first way
I added exists filter to query but I had to separate two different facets
and create two different queries instead of one query with two facets
filtered with facet filters But this works as well.
In my case the copy of testobj.obj1 object will not work because I need to
count the number of testobj.obj1 elements not the number of root documents
(am I right this would count the number of documents not the number of
testobj.obj1 elements?).
I just wanted to know if it is possible to access root document's fields
from the nested query. If not I will leave the solution like I said before.
The problem is that your facet is running an a nested object:
"nested":"testobj.obj1",
which means that it can't see field testobj.idtest
To be clear, a nested object is a SEPARATE doc internally. So either,
you need to use the 'exists' filter as part of the query, or you can
configure your main object to also store a copy of the nested object
data:
I was afraid that these were the only one solutions. I did it the
first way - I added exists filter to query but I had to separate two
different facets and create two different queries instead of one query
with two facets filtered with facet filters But this works as well.
In my case the copy of testobj.obj1 object will not work because I
need to count the number of testobj.obj1 elements not the number of
root documents (am I right this would count the number of documents
not the number of testobj.obj1 elements?).
I just wanted to know if it is possible to access root document's
fields from the nested query. If not I will leave the solution like I
said before.
It's not possible. But what about including a copy of that field in
your nested docs? You would have to do it manually, and it'd take more
space, but you'd achieve what you're after
>
> You are right, I added curl_queries.sh in gist
> https://gist.github.com/d3234db747e6e845d1e5
Got it.
The problem is that your facet is running an a nested object:
"nested":"testobj.obj1",
which means that it can't see field testobj.idtest
To be clear, a nested object is a SEPARATE doc internally. So
either,
you need to use the 'exists' filter as part of the query, or
you can
configure your main object to also store a copy of the nested
object
data:
{
type: "nested",
include_in_root: true,
properties: {.... }
}
Then, instead of running your facet on the nested object, run
it on the
main object (just by leaving out this line:
"nested":"testobj.obj1")
Depending on your data, this may or may not suit your purposes
clint
I was afraid that these were the only one solutions. I did it the
first way - I added exists filter to query but I had to separate two
different facets and create two different queries instead of one query
with two facets filtered with facet filters But this works as well.
In my case the copy of testobj.obj1 object will not work because I
need to count the number of testobj.obj1 elements not the number of
root documents (am I right this would count the number of documents
not the number of testobj.obj1 elements?).
I just wanted to know if it is possible to access root document's
fields from the nested query. If not I will leave the solution like I
said before.
It's not possible. But what about including a copy of that field in
your nested docs? You would have to do it manually, and it'd take more
space, but you'd achieve what you're after
>
> You are right, I added curl_queries.sh in gist
> https://gist.github.com/d3234db747e6e845d1e5
Got it.
The problem is that your facet is running an a nested object:
"nested":"testobj.obj1",
which means that it can't see field testobj.idtest
To be clear, a nested object is a SEPARATE doc internally. So
either,
you need to use the 'exists' filter as part of the query, or
you can
configure your main object to also store a copy of the nested
object
data:
{
type: "nested",
include_in_root: true,
properties: {.... }
}
Then, instead of running your facet on the nested object, run
it on the
main object (just by leaving out this line:
"nested":"testobj.obj1")
Depending on your data, this may or may not suit your purposes
clint
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.