[percolate_query] mapping for `percolator type` in script(painless)

Hello

I'm Checking how to update "percolate query" > "percolator type" field through _update_by_query.
But,

# Create Index
PUT test_shlee_percolate_20230619
{
  "mappings": {
    "properties": {
      "pa001": {
        "type": "percolator"
      },
      "a001":{
        "type": "keyword"
      }
    }
  }
}

# PUT doc
PUT test_shlee_percolate_20230619/_doc/1
{
  "query": {
    "query_string":{
      "query":"a001:(\"value\")"
    }
  }
}


To create a field with "update_by_query" on this

POST test_shlee_percolate_20230619/_update_by_query?wait_for_completion=false
{
  "script": {
    "source": "ctx._source.query.query_string.query = \"pa001:(ctx._source.a001)\"",
    "lang": "painless"
  }
}

I'm thinking of it in this way.
But,

# error msg
  "error": {
    "type": "script_exception",
    "reason": "runtime error",
    "script_stack": [
      "ctx._source.query.query_string.query = \"pa001:(ctx._source.a001)\"",
      "                 ^---- HERE"
    ],
    "script": "ctx._source.query.query_string.query = \"pa001:(ctx._source.a001)\"",
    "lang": "painless",
    "position": {
      "offset": 17,
      "start": 0,
      "end": 65
    },
    "caused_by": {
      "type": "null_pointer_exception",
      "reason": "cannot access method/field [query_string] from a null def reference"
    }
  }

In the right side of 'script > source', :(colon) cannot be compiled.
Is there any other way?
OR
Is it some kind of bug or undeveloped?

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