title: ElasticSearch [script] unknown field [file], parser not found
body: <p>I used <code>script_score</code> to customize the scoring:</p>
  
  <pre><code>GET /customer/_search
  {
      "query": {
          "function_score": {
              "query": {
                  "match": {
                      "name": "Mark"
                  }
              },
              "script_score": {
                "script": {
                  "lang": "painless",
                  "file": "test"
                }
              }
          }
      }
  }
  </code></pre>
  
  <p>I set <code>"file": "test"</code>, and put <code>test.groovy</code> file in <code>config/scripts</code> directory, but I got these error:</p>
  
  <pre><code>{
    "error": {
      "root_cause": [
        {
          "type": "illegal_argument_exception",
          "reason": "[script] unknown field [file], parser not found"
        }
      ],
      "type": "illegal_argument_exception",
      "reason": "[script] unknown field [file], parser not found"
    },
    "status": 400
  }
  </code></pre>
  
  <p><code>[script] unknown field [file], parser not found</code>! Why? Should I need to install some plugins?</p>
  
  <p><strong>Elasticsearch version</strong> : 6.2.3</p>
  
  <p><strong>Plugins installed</strong>: None</p>
  
  <p><strong>JVM version</strong> : 1.8.0_181</p>
  
  <p><strong>OS version</strong>: Ubuntu Linux 4.4.0-124-generic</p>