ElasticSearch:filtering documents based on field length

Viewed 3961


I read couple of similar problems on SO and suggest solution not work..
I want to find all fields where word is shorter than 8

my database screen:

database rows screen capture

I tried to do this using this query

{
  "query": {
    "match_all": {}
  },
  "filter": {
    "script": {
      "script": "doc['word'].length < 5"
    }
  }
}

what I doing wrong? I miss something?

1 Answers
Related