I am trying to filter the documents using terms filter. I am not sure how to introduce wildcards in filter. I tried something like this:
"filter":{
"bool":{
"must":{
"terms":{
"wildcard" : {
"aircraft":[
"a380*"
]
}
}
}
}
}
But I get SearchParseException with this. Is there no way to use wildcard within filter framework?
The
terms
filter doesn't support wildcards, queries do, though. Try this query insteadOr if you absolutely need to use filters, you can try the
regexp
filter, too: