title: Elasticsearch painless returns wrong long values
body: <p>Elasticsearch returns the rounded value when I try to get millis from the timestamp (using docker.elastic.co/elasticsearch/elasticsearch:7.11.0 image).</p>
  <p>My mappings:</p>
  <pre><code>{
      &quot;mappings&quot;: {
          &quot;properties&quot;: {
           ...
              &quot;updated_at&quot;: {
                  &quot;type&quot;: &quot;date&quot;
              }
           ...
          }
      }
  }
  </code></pre>
  <p>My script query:</p>
  <pre><code>{
      &quot;query&quot;: {
          &quot;script_score&quot;: {
              &quot;query&quot;: {
                  &quot;match_all&quot;: {}
              },
              &quot;script&quot;: {
                  &quot;source&quot;: &quot;doc['updated_at'].value.millis&quot;
              }
          }
      }
  }
  </code></pre>
  <p>Results:</p>
  <pre><code>{
      ...
      &quot;hits&quot;: {
          ...
          &quot;max_score&quot;: 1616185130000,
          &quot;hits&quot;: [
              {
                  ...
                  &quot;_score&quot;: 1616185130000,    &lt;---- wrong value
                  &quot;_source&quot;: {
                      ...
                      &quot;updated_at&quot;: 1616185148409    &lt;---- should be this
                  }
              },
              {
                  ...
                  &quot;_score&quot;: 1616185130000,    &lt;---- same wrong value even if updated_at is different
                  &quot;_source&quot;: {
                      ...
                      &quot;updated_at&quot;: 1616185148408    &lt;---- should be this
                  }
              }
              ...
  </code></pre>
  <p>Also tried with long type in mappings:</p>
  <pre><code>{
      &quot;mappings&quot;: {
          &quot;properties&quot;: {
           ...
              &quot;updated_at&quot;: {
                  &quot;type&quot;: &quot;long&quot;
              }
           ...
          }
      }
  }
  </code></pre>
  <p>Query:</p>
  <pre><code>{
      &quot;query&quot;: {
          &quot;script_score&quot;: {
              &quot;query&quot;: {
                  &quot;match_all&quot;: {}
              },
              &quot;script&quot;: {
                  &quot;source&quot;: &quot;doc['updated_at'].value&quot;
              }
          }
      }
  }
  </code></pre>
  <p>And got the same results.</p>
  <p>I can't use sorting because we need boost by formula and I stuck with this issue.</p>