Suppose I have a document with a "tags" field which is an array (just
as here http://www.elasticsearch.org/guide/reference/mapping/array-type.html)
Is it possible to query for documents do not contain a given tag?
Thanks,
Adam
Suppose I have a document with a "tags" field which is an array (just
as here http://www.elasticsearch.org/guide/reference/mapping/array-type.html)
Is it possible to query for documents do not contain a given tag?
Thanks,
Adam
Hi Adam
On Wed, 2011-05-04 at 02:20 -0700, Adam Warski wrote:
Suppose I have a document with a "tags" field which is an array (just
as here Elasticsearch Platform — Find real-time answers at scale | Elastic)Is it possible to query for documents do not contain a given tag?
curl -XGET 'http://127.0.0.1:9200/myindex/mytype/_search?pretty=1' -d '
{
"query" : {
"constant_score" : {
"filter" : {
"not" : {
"filter" : {
"term" : {
"tags" : "foo"
}
}
}
}
}
}
}
'
Ah, so simple, thanks!
Adam
On May 4, 11:27 am, Clinton Gormley clin...@iannounce.co.uk wrote:
Hi Adam
On Wed, 2011-05-04 at 02:20 -0700, Adam Warski wrote:
Suppose I have a document with a "tags" field which is an array (just
as herehttp://www.elasticsearch.org/guide/reference/mapping/array-type.html)Is it possible to query for documents do not contain a given tag?
curl -XGET 'http://127.0.0.1:9200/myindex/mytype/_search?pretty=1' -d '
{
"query" : {
"constant_score" : {
"filter" : {
"not" : {
"filter" : {
"term" : {
"tags" : "foo"
}
}
}
}
}
}}'
© 2020. All Rights Reserved - Elasticsearch
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.