Length of a field - Multi-line

Hi All,
Need some help with writing a query. I have a field called receipttext (mapped as a text and keyword) and it contains data that spans over multiple lines (eg. think of a receipt that you get from a purchase).

I am trying to write a query to brings back all the documents that have over 700 characters (this is an issue I'm troubleshooting). I have this so far, but its not working as expect. Any ideas?

    {
      "query": {
        "bool": {
          "filter": [
            {
              "script": {
                "script": "doc['receipttext.keyword'].length > 700"
              }
            }
          ]
        }
      }
    }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.