I have documents that have a list of labels:
{
"fields": {
"label": [
"foo",
"bar",
"baz"
],
"name": [
"Document One"
],
"description" : "A fine first document",
"id" : 1
}
},
{
"fields": {
"label": [
"foo",
"dog"
],
"name": [
"Document Two"
],
"description" : "A fine second document",
"id" : 2
}
}
I have a list of terms:
[ "foo", "bar", "qux", "zip", "baz"]
I want a query that will return documents that have labels in the list of terms - but no other terms.
So given the list above, the query would return Document One, but not Document Two (because it has the term dog that is not in the list of terms.
I was able to achieve this with a Groovy script (here's the details in a StackOverflow answer).
However, we're interested in using Amazon's new Elasticsearch service offering. This does not allow dynamic scripting.
Is there another way to accomplish this, without using scripting?
cheers
adam
Adam Feuer
CookBrite, Inc.
Seattle, WA, USA