Calculated fields in Search Filter

Hi,

Is it possible to be able to create a search filter based on a calculated/computed field?
I have this document :

{
"amount": 100,
"taxe": 10,
[...]
}

I want to be able to search only records where "amount" + "taxe" <= 100
I saw that it exists (script_fields) for elastic :

GET /_search
{
  "query": {
    "match_all": {}
  },
  "script_fields": {
    "test1": {
      "script": {
        "lang": "painless",
        "source": "doc['price'].value * 2"
      }
    }
}

Does this exist for App Search? Or is there a solution to do this?

Thanks

Hi Steven,

Unfortunately, this is not possible in App Search at this time. Supported filters types are listed here:

Look at the second example here Script query | Elasticsearch Guide [8.1] | Elastic

It calculates amount.signed then matches if that is less than 10.

unfortunately yes ...

It's for elastic not App Search :confused:

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