title: cannot resolve symbol[string] when using updateByQuery with ElasticSearch
body: <p>I have the following set-up:</p>
  <p>mapping:</p>
  <pre><code>esClient.indices.putMapping({
    index: 'tests',
    body: {
      properties: {
        name: {
          type: 'text',
        },
        lastName: {
          type: 'text',
        },
      },
    },
  });
  </code></pre>
  <p>this is the result when I post an entry:</p>
  <p><a href="https://i.stack.imgur.com/4Oz9H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Oz9H.png" alt="enter image description here" /></a></p>
  <p>this is the result when I query the entries:</p>
  <pre><code>curl -X GET &quot;localhost:9200/tests/_search?pretty&quot; -H 'Content-Type: application/json' -d'       
  {
  &quot;size&quot;: 1000,
  &quot;query&quot; : {
      &quot;match_all&quot; : {}
    }
  }
  '
  {
    &quot;took&quot; : 18,
    &quot;timed_out&quot; : false,
    &quot;_shards&quot; : {
      &quot;total&quot; : 1,
      &quot;successful&quot; : 1,
      &quot;skipped&quot; : 0,
      &quot;failed&quot; : 0
    },
    &quot;hits&quot; : {
      &quot;total&quot; : {
        &quot;value&quot; : 1,
        &quot;relation&quot; : &quot;eq&quot;
      },
      &quot;max_score&quot; : 1.0,
      &quot;hits&quot; : [
        {
          &quot;_index&quot; : &quot;tests&quot;,
          &quot;_type&quot; : &quot;_doc&quot;,
          &quot;_id&quot; : &quot;KJbtj3kBRlqnip7VJLLI&quot;,
          &quot;_score&quot; : 1.0,
          &quot;_source&quot; : {
            &quot;lastName&quot; : 1,
            &quot;name&quot; : &quot;lucas&quot;
          }
        }
      ]
    }
  }
  </code></pre>
  <p><strong>I tried to update the entry's last name with the following curl:</strong></p>
  <pre><code>curl -X POST &quot;localhost:9200/tests/_update_by_query?pretty&quot; -H 'Content-Type: application/json' -d'
  {
    &quot;script&quot;: {
      &quot;source&quot;: &quot;ctx._source.lastName='johnson'&quot;,
      &quot;lang&quot;: &quot;painless&quot;
    },
    &quot;query&quot;: {
      &quot;term&quot;: {
        &quot;name&quot;: &quot;lucas&quot;
      }
    }
  }
  '
  </code></pre>
  <p>AND THIS IS THE ERROR I'M GETTIN:</p>
  <pre><code>    {
    &quot;error&quot; : {
      &quot;root_cause&quot; : [
        {
          &quot;type&quot; : &quot;script_exception&quot;,
          &quot;reason&quot; : &quot;compile error&quot;,
          &quot;script_stack&quot; : [
            &quot;ctx._source.lastName=johnson&quot;,
            &quot;                     ^---- HERE&quot;
          ],
          &quot;script&quot; : &quot;ctx._source.lastName=johnson&quot;,
          &quot;lang&quot; : &quot;painless&quot;,
          &quot;position&quot; : {
            &quot;offset&quot; : 21,
            &quot;start&quot; : 0,
            &quot;end&quot; : 28
          }
        }
      ],
      &quot;type&quot; : &quot;script_exception&quot;,
      &quot;reason&quot; : &quot;compile error&quot;,
      &quot;script_stack&quot; : [
        &quot;ctx._source.lastName=johnson&quot;,
        &quot;                     ^---- HERE&quot;
      ],
      &quot;script&quot; : &quot;ctx._source.lastName=johnson&quot;,
      &quot;lang&quot; : &quot;painless&quot;,
      &quot;position&quot; : {
        &quot;offset&quot; : 21,
        &quot;start&quot; : 0,
        &quot;end&quot; : 28
      },
      &quot;caused_by&quot; : {
        &quot;type&quot; : &quot;illegal_argument_exception&quot;,
        &quot;reason&quot; : &quot;cannot resolve symbol [johnson]&quot;
      }
    },
    &quot;status&quot; : 400
  }
  </code></pre>
  <p>If I put an integer instead of a string it updates it otherwise I keep getting that error.</p>
  <p>Thanks a lot for your help.</p>