{
"query": {
"bool": {
"must": [
{ "term": { "meta_key.normalized": "Content" } }
]
}
}
}
{ "meta_key.normalized": "Content" } содержится только у некоторых поэтому получаю 4 записи
{ "query": {
"bool": {
"must": [
{ "term": { "meta_values.normalized": "Text" } }
]
}
}
}
{ "meta_values.normalized": "Text" } содержится у всех поэтому у меня по этому запросу получается 6 записей как мне получить все записи у которых есть { "meta_values.normalized": "Text" } но отсутствует { "term": { "meta_key.normalized": "Content" } }
So I made the following request where I select all assets that have Asset Type Text and that do not have Content, but it doesn’t give me the same results
I don't understand why you're nesting your boolean must_not query under the must clauses instead of creatin a must_not clause in the same boolean query. The boolean query docs should be helpful here.
Also, you're doing a bunch of stuff with wildcards etc. that aren't related to the original question. Keep it as simple as possible. Also make sure that your mappings are correct (text vs. keyword).
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.