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
{{ message }}
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.
I've done some digging in the source and found this:
if( fbutil.isString(queryData.body) ) {
queryData.body = this._getJSON(queryData.body);
if( queryData.body === null ) {
this._replyError(key, 'Search body was a string but did not contain a valid JSON object. It must be an object or a JSON parsable string.');
}
return null;
}
When you've stringified the body so it looks like this:
It seems to me like the first snippet shouldn't return null, but rather something else. Such as queryData.body, however I tried to change it to this but then I got an error for my query. I am not sure if it's down to it being an invalid query but here it is:
I tried removing the return altogether and then a stringed query works as expected. I am unsure as to if this will cause other things to break however.
You did not include query (deprecated/legacy), body (object|string) or q (string) code
The body attribute was a string but did not contain valid JSON code
If you've verified that it's returning null when the body is a string, then it means it's not a valid JSON string, and there would be a warning in the logs.
It does seem like, rather than returning null in the _process method, we could return an error to the client. That part looks incorrect, but the end result is accurate--the body isn't valid JSON.
I've done some digging in the source and found this:
When you've stringified the body so it looks like this:
body: "{"query":{"bool":{"must":[{"nested":{"path":"guestlist","query":{"bool":{"must":[{"path":"list","query":{"bool":{"must":[{"match_phrase_prefix":{"list.name":"c"}}]}}}]}}}}]}}}"
This snippet below just returns
null
, causing the actual search function not to run at all sincequery
isnull
here:It seems to me like the first snippet shouldn't return null, but rather something else. Such as
queryData.body
, however I tried to change it to this but then I got an error for my query. I am not sure if it's down to it being an invalid query but here it is:And the error it spits out is:
I hope you can investigate this.
The text was updated successfully, but these errors were encountered: