I’m a big fan of ElasticSearch. One of the products in the Elastic suite is App Search.
I tried to get some documents through the App Search API using the following code:
Unfortunately this didn’t work but resulted in the following error message:
JSON must be an array or hash
The reason I got this exception is because the API is expecting a JSON array or object for the id parameter.
Unstructured JSON data is not permitted. You have to encapsulate your object in an array [] or a hash {} (what the error message is referring to).
If you are using query parameters, ensure that ids is followed with %5D%5B - this is an array, but escaped: ?ids%5D%5B=: