Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation incorrect - reference/2.0/modules-scripting.html #15096

Closed
nicksanders opened this issue Nov 29, 2015 · 6 comments
Closed

Documentation incorrect - reference/2.0/modules-scripting.html #15096

nicksanders opened this issue Nov 29, 2015 · 6 comments
Assignees
Labels
>bug :Search/Search Search-related issues that do not fall into other categories

Comments

@nicksanders
Copy link

https://www.elastic.co/guide/en/elasticsearch/reference/2.0/modules-scripting.html

Documentation example below causes "script_score query does not support [file]" error

     "script_score": {
        "lang": "groovy",
        "file": "calculate-score",
        "params": {
          "my_modifier": 8
        }
      }

Should be

"script_file": "calculate-score"

@clintongormley
Copy link

The script_score in function score still uses the old scripting syntax. Must have been missed in the script cleanup in #11164

@colings86 could you take a look please?

@clintongormley
Copy link

whoops - i tested the wrong syntax, script_score works as intended.

@nicksanders presumably you're not using Elasticsearch 2.0. You should look at the documentation for the version you're using

@nicksanders
Copy link
Author

@clintongormley I was using Elasticsearch 2.0 and got the following error

script_score query does not support [file]

It is possible I was doing something else wrong but when I changed "file" to "script_file" it worked ;)

@clintongormley
Copy link

@nicksanders you're missing one layer (and so you're using the undocumented bwc syntax). Should be:

"script_score": {
  "script": {
    "lang": "groovy",
    "file": "calculate-score",
    "params": {
      "my_modifier": 8
    }
  }
}

See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-script-score

@nicksanders
Copy link
Author

clintongormley added a commit that referenced this issue Nov 30, 2015
Fix script syntax for script_score

Closes #15096
@clintongormley
Copy link

thanks @nicksanders - fixed

clintongormley added a commit that referenced this issue Nov 30, 2015
Fix script syntax for script_score

Closes #15096
clintongormley added a commit that referenced this issue Nov 30, 2015
Fix script syntax for script_score

Closes #15096
clintongormley added a commit that referenced this issue Nov 30, 2015
Fix script syntax for script_score

Closes #15096
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

3 participants