Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. root@staging-discovery-78b9d8bb89-8zppf:/app# curl -X GET "elasticsearch-elasticsearch-svc:9200/listings/_search?pretty=true" -H 'Content-Type: application/json' -d'
  2. > {
  3. > "query" : {
  4. > "match_all": {}
  5. > },
  6. > "sort" : {
  7. > "_script" : {
  8. > "type" : "number",
  9. > "script" : {
  10. > "lang": "painless",
  11. > "source": "if(params._source.containsKey(\"price\") && params._source.price.containsKey(\"currency\") && params._source.price.currency.containsKey(\"id\")) { return Float.parseFloat(params._source.price.amount) * Float.parseFloat(params.exchangeRates[params._source.price.currency.id]); } else { return params.order == \"asc\" ? 100000000000 : 0 }",
  12. > "params" : {
  13. > "order": "asc",
  14. > "exchangeRates" : {
  15. > "fiat-USD" : "1.0",
  16. > "fiat-EUR" : "1.0749",
  17. > "fiat-GBP" : "1.216",
  18. > "fiat-KRW" : "0.00061",
  19. > "fiat-JPY" : "0.00917",
  20. > "token-ETH" : "215.269",
  21. > "token-DAI" : "1.0000475"
  22. > }
  23. > }
  24. > },
  25. > "order" : "asc"
  26. > }
  27. > }
  28. > }
  29. > '
  30. {
  31. "error" : {
  32. "root_cause" : [
  33. {
  34. "type" : "script_exception",
  35. "reason" : "compile error",
  36. "script_stack" : [
  37. "... params.order == \"asc\" ? 100000000000 : 0 }",
  38. " ^---- HERE"
  39. ],
  40. "script" : "if(params._source.containsKey(\"price\") && params._source.price.containsKey(\"currency\") && params._source.price.currency.containsKey(\"id\")) { return Float.parseFloat(params._source.price.amount) * Float.parseFloat(params.exchangeRates[params._source.price.currency.id]); } else { return params.order == \"asc\" ? 100000000000 : 0 }",
  41. "lang" : "painless"
  42. }
  43. ],
  44. "type" : "search_phase_execution_exception",
  45. "reason" : "all shards failed",
  46. "phase" : "query",
  47. "grouped" : true,
  48. "failed_shards" : [
  49. {
  50. "shard" : 0,
  51. "index" : "listings_4",
  52. "node" : "eGOsM1SOT_OhK-ruytxS_w",
  53. "reason" : {
  54. "type" : "script_exception",
  55. "reason" : "compile error",
  56. "script_stack" : [
  57. "... params.order == \"asc\" ? 100000000000 : 0 }",
  58. " ^---- HERE"
  59. ],
  60. "script" : "if(params._source.containsKey(\"price\") && params._source.price.containsKey(\"currency\") && params._source.price.currency.containsKey(\"id\")) { return Float.parseFloat(params._source.price.amount) * Float.parseFloat(params.exchangeRates[params._source.price.currency.id]); } else { return params.order == \"asc\" ? 100000000000 : 0 }",
  61. "lang" : "painless",
  62. "caused_by" : {
  63. "type" : "illegal_argument_exception",
  64. "reason" : "Invalid int constant [100000000000]. If you want a long constant then change it to [100000000000L]."
  65. }
  66. }
  67. }
  68. ]
  69. },
  70. "status" : 500
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement