title: Check value exists in params array using ElasticSearch painless script
body: <p>I am new to ElasticSearch. I am working on a project where I have to search listings which matches the input <code>http://foo.bar/search?listing=123,456</code>. I have built an array which key and value are the same and representing the listing ids. I have tried to run the following example but it failed near contains. The script is built for painless language. However, I always get the runtime error. </p>
  
  <p>I cannot get this to work, what could I be doing wrong?</p>
  
  <pre><code> 'function_score' =&gt; [
         'query' =&gt; $query,
             'score_mode' =&gt; 'sum',
                'functions' =&gt; [[
                  'script_score' =&gt; [
                   'script' =&gt; [
                     'params' =&gt; ['listing' =&gt; [123 =&gt; 123, 456 =&gt; 456]],
      'source' =&gt; "(params.listing.contains(doc['id'].value) ? Math.pow(3, 3) : 0)",
                              ],
                          ],
                      ]],
                  ],
  </code></pre>