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

Script sorting doesn't accept parameters #1382

Closed
clintongormley opened this issue Oct 8, 2011 · 0 comments
Closed

Script sorting doesn't accept parameters #1382

clintongormley opened this issue Oct 8, 2011 · 0 comments

Comments

@clintongormley
Copy link

Hiya

There is a bug when providing params to a script sort. Depending on the position of the params parameter in the JSON, you get 2 different error messages:

curl -XPUT 'http://127.0.0.1:9200/foo/?pretty=1' 
curl -XPOST 'http://127.0.0.1:9200/foo/bar?pretty=1'  -d '
{
   "text" : "foo"
}
'

Parse Failure [_script sorting requires setting the script to sort by]]; }]

curl -XGET 'http://127.0.0.1:9200/foo/_search?pretty=1'  -d '
{
   "sort" : {
      "_script" : {
         "params" : {
            "one" : 1
         },
         "script" : "one",
         "type" : "number"
      }
   }
}
'

PropertyAccessException[[Error: unresolvable property or identifier: one]

curl -XGET 'http://127.0.0.1:9200/foo/_search?pretty=1'  -d '
{
   "sort" : {
      "_script" : {
         "script" : "one",
         "type" : "number",
         "params" : {
            "one" : 1
         }
      }
   }
}
'
@kimchy kimchy closed this as completed in 9396735 Oct 18, 2011
dadoonet pushed a commit to dadoonet/elasticsearch that referenced this issue Nov 3, 2011
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
This commit introduces a 3rd party plugin to co-locate
scala docs with java docs. https://github.com/lightbend/genjavadoc

Fixes: elastic#1363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants