We are trying to perform this curl command:
curl -X POST -H "Content-type:application/json" -u "USERNAME":"PASSWORD" "https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/CLUSTER_ID/solr/COLLECTION_NAME/schema/analysis/synonyms/english" --data-binary "["ARS","Argentinian Peso"]"
The result:
{
"responseHeader": {
"status": 500,
"QTime": 2
},
"error": {
"msg": "Expected ',' or ']': char=(EOF),position=16 BEFORE='[ARS,Argentinian'",
"trace": "org.noggit.JSONParser$ParseException: Expected ',' or ']': char=(EOF),position=16 BEFORE='[ARS,Argentinian'\n\tat org.noggit.JSONParser.err(JSONParser.java:356)\n\tat org.noggit.JSONParser.nextEvent(JSONParser.java:983)\n\tat org.noggit.ObjectBuilder.getArray(ObjectBuilder.java:149)\n\tat org.noggit.ObjectBuilder.getVal(ObjectBuilder.java:59)\n\tat org.noggit.ObjectBuilder.getVal(ObjectBuilder.java:37)\n\tat org.noggit.ObjectBuilder.fromJSON(ObjectBuilder.java:33)\n\tat org.apache.solr.rest.RestManager$ManagedEndpoint.parseJsonFromRequestBody(RestManager.java:425)\n\tat org.apache.solr.rest.RestManager$ManagedEndpoint.post(RestManager.java:351)\n\tat org.restlet.resource.ServerResource.doHandle(ServerResource.java:454)\n\tat org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:359)\n\tat org.restlet.resource.ServerResource.handle(ServerResource.java:1044)\n\tat org.restlet.resource.Finder.handle(Finder.java:236)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.routing.Router.doHandle(Router.java:422)\n\tat org.restlet.routing.Router.handle(Router.java:639)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)\n\tat org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:75)\n\tat org.restlet.Application.handle(Application.java:385)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.routing.Router.doHandle(Router.java:422)\n\tat org.restlet.routing.Router.handle(Router.java:639)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.routing.Router.doHandle(Router.java:422)\n\tat org.restlet.routing.Router.handle(Router.java:639)\n\tat org.restlet.routing.Filter.doHandle(Filter.java:150)\n\tat org.restlet.routing.Filter.handle(Filter.java:197)\n\tat org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)\n\tat org.restlet.Component.handle(Component.java:408)\n\tat org.restlet.Server.handle(Server.java:507)\n\tat org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63)\n\tat org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143)\n\tat org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:595)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:191)\n\tat org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:72)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:266)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:208)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:499)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\n\tat java.lang.Thread.run(Thread.java:745)\n",
"code": 500
}
}
curl: (3) [globbing] unmatched close brace/bracket in column 5
Do you have any idea why? The API doesn't support "multi-term" synonyms?
Thank you for your help.