You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the opensearchJs client to send requests. When looking through the docs there are no examples on how a multisearch query body should be structured in order to use the client correctly.
Does the user need to format the body such that each query needs to be on a single line as defined here or does the client do this formatting if given a normal array of json objects as seen in the example here using the Ruby api for elasticsearch?
Also, if each object needs to be on a single line, could this be achieved by simply doing a JSON.stringify on the object, as in:
@hyprstack The body that the _msearch endpoint accepts is a string representation of NDJSON (newline deliminated JSON: A collection of JSON objects that are seperated by \n). You can manually do the serialization and turn your array of objects into said string OR you can just pass the array of objects as is to the client.msearch method. The client will detect that it's an array and perform the serialization for you.
@tejeshreddy You can add an entry in guides folder called msearch.md with working examples and instructions.
I am using the opensearchJs client to send requests. When looking through the docs there are no examples on how a multisearch query body should be structured in order to use the client correctly.
Does the user need to format the body such that each query needs to be on a single line as defined here or does the client do this formatting if given a normal array of json objects as seen in the example here using the Ruby api for elasticsearch?
Also, if each object needs to be on a single line, could this be achieved by simply doing a JSON.stringify on the object, as in:
i.e. do I need to format the body to
Or could I pass in
The text was updated successfully, but these errors were encountered: