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'm encounter json serialize error when trying search method to get documents via JAVA SDK,
here are the sample code.
here is the error stacktrace
Meilisearch ApiException: {Error=APIError: {message='Invalid value type at .attributesToHighlight: expected an array, but found a string: "**[Ljava.lang.String;@10fc5e2f**"', code='invalid_search_attributes_to_highlight', type='invalid_request', link='https://docs.meilisearch.com/errors#invalid_search_attributes_to_highlight'}}
pls refer the highlighted part, I noticed that org.json.JSONObject wrongly serialize the String arrary to [Ljava.lang.String;@10fc5e2f
any idea to reslove this issue? as workaround, I'm using JAVA API to do the search instead temporary.
Environment (please complete the following information):
OS: windows 10
Meilisearch version: v1.4.2
meilisearch-java version: v0.11.5
org.json version: 20231013, as sdk pom required
The text was updated successfully, but these errors were encountered:
i have a similar issue when using SearchRequestBuilder.
by debug, i found that SearchRequest.toString() converted array fields like attributesToHighlight to [Ljava.lang.String;@xxxxxx instead of ["xxx", "yyy"]
the toString method uses org.json.JSONObject to convert object to json string. obviously the org.json.JSONObject can't handle array fields as we expect.
i found that the class i use is actually org.json.JSONObject from com.vaadin.external.google:android-json instead of org.json
if you remove com.vaadin.external.google:android-json from your project like below, the problem will be fixed.
I'm encounter json serialize error when trying search method to get documents via JAVA SDK,
here are the sample code.
here is the error stacktrace
Meilisearch ApiException: {Error=APIError: {message='Invalid value type at
.attributesToHighlight
: expected an array, but found a string:"**[Ljava.lang.String;@10fc5e2f**"
', code='invalid_search_attributes_to_highlight', type='invalid_request', link='https://docs.meilisearch.com/errors#invalid_search_attributes_to_highlight'}}pls refer the highlighted part, I noticed that org.json.JSONObject wrongly serialize the String arrary to [Ljava.lang.String;@10fc5e2f
any idea to reslove this issue? as workaround, I'm using JAVA API to do the search instead temporary.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: