I would like to find only those that have an author. However, both the
Id and Name of the author can be null.
My first instinct was to try:
{
"filter":{
"exists":{
"field":"Author"
}
}
}
However that doesn't work. I'm guessing that's the case because Author
isn't actually a field, only it's child properties are?
I could of course filter on one of the Author properties child-
properties but seeing how they could both be null I would probably
have to do an OR filter on both which seems like a last resort.
Any ideas?
Sorry if this is a question that has been answered before. I've done
my best trying to find discussions about similar problems but with no
luck.
Yes, you will need to explicitly OR between the author fields, no way
around it unless you add a special marker boolean field on each author
object, and only ask on it (better for perf).
I would like to find only those that have an author. However, both the
Id and Name of the author can be null.
My first instinct was to try:
{
"filter":{
"exists":{
"field":"Author"
}
}
}
However that doesn't work. I'm guessing that's the case because Author
isn't actually a field, only it's child properties are?
I could of course filter on one of the Author properties child-
properties but seeing how they could both be null I would probably
have to do an OR filter on both which seems like a last resort.
Any ideas?
Sorry if this is a question that has been answered before. I've done
my best trying to find discussions about similar problems but with no
luck.
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.