i am trying to run a script with query filter. the script should return me all books with title gt 30:
GET books/_search
{
"filter" : {
"script" : {
"script" : "_source.title?.length() > 30"
}
}
}
this works.
but if i try to add some filter, like i want all the books that not has 'type' field :
GET book/_search
{
"filter" : {
"script" : {
"script" : "_source.title?.length() > 30"
},
"missing" : { "field" : "type" },
}
}
then i get error:
nested: ElasticsearchParseException[Expected field name but got START_OBJECT \"exists\"]; }]
so i can i query for missing fields with script filter?