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

Comments

Projects
None yet
2 participants
@clintongormley
Member

clintongormley commented Oct 8, 2011

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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment