0

We are trying to delete synonyms using the following curl command.

curl -v -X DELETE -u "username":"password" "https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/CLUSTER/solr/COLLECTION/schema/analysis/synonyms/english/mad"

We are getting as a result:

 *   Trying 158.85.132.88...
 * TCP_NODELAY set
 * Connected to gateway.watsonplatform.net (158.85.132.88) port 443 (#0)
 * ALPN, offering h2
 * ALPN, offering http/1.1
 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
 * successfully set certificate verify locations:
 *   CAfile: D:\NB16647\Desktop\curl-7.50.3-win64-mingw\bin\curl-ca-bundle.crt
   CApath: none
 * TLSv1.2 (OUT), TLS handshake, Client hello (1):
 * TLSv1.2 (IN), TLS handshake, Server hello (2):
 * TLSv1.2 (IN), TLS handshake, Certificate (11):
 * TLSv1.2 (IN), TLS handshake, Server finished (14):
 * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
 * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
 * TLSv1.2 (OUT), TLS handshake, Finished (20):
 * TLSv1.2 (IN), TLS handshake, Finished (20):
 * SSL connection using TLSv1.2 / AES256-GCM-SHA384
 * ALPN, server did not agree to a protocol
 * Server certificate:
 *  subject: C=US; ST=New York; L=Armonk; O=International Business Machines Corporation; CN=*.watsonplatform.net
 *  start date: Jan 30 00:00:00 2015 GMT
 *  expire date: Jan 29 23:59:59 2018 GMT
 *  subjectAltName: host "gateway.watsonplatform.net" matched cert's "*.watsonplatform.net"
 *  issuer: C=US; O=GeoTrust Inc.; CN=GeoTrust SSL CA - G3
 *  SSL certificate verify ok.
 * Server auth using Basic with user 'USERNAME'
 > DELETE /retrieve-and-rank/api/v1/solr_clusters/CLUSTER/solr/COLLECTION/schema/analysis/synonyms/english/mad HTTP/1.1
 > Host: gateway.watsonplatform.net
 > Authorization: Basic MDkzYzg2ZTEtM2UwMy00NWM2LThmNWMtNDVkN2RlNzM1ZTQyOnhteGV2UzBPTmlsWQ==
 > User-Agent: curl/7.50.3
 > Accept: */*
 >
 < HTTP/1.1 405 Method Not Allowed
 < X-Backside-Transport: FAIL FAIL
 < Connection: Keep-Alive
 < Transfer-Encoding: chunked
 < Date: Fri, 21 Oct 2016 16:04:51 GMT
 < Allow: HEAD,POST,GET,OPTIONS
 < Server: -
 < Set-Cookie: Watson-DPAT=gYvN5yLQe3JmVm1d496bA85NFBCd4bWgyvYv8YoV%2FpOlj6ZOsGxVcKZUaR9SUb5L6Ch5SYrSzIe2BSZCk0VvRLQW%2BKeBpz%2B2lpCfmiYvvXWnzah6GmQMnd4AuH3e0hJOb6SORsjOAggLiMweaA6khvQLxqgU2RR5%2FEfemnk6SP3p04YUMHUQRRo4orabJuANouni4RyJJXuCwotrpbNnNwL%2FyFVT2KlxusaLe5V1gxoCsKonKJTzaxtKJDxetwqZ20pPaZ2wZkY4eA9pYlBb6T5gN9bOsHPhxGCtpATG6bK5MpVfHpLi4ae9V2oliLbNqq7VQo%2FRvtHk5%2B1FUmLmY3pYX975Yni0LGkcCnjkbSxNvdelq1PJa3MIAAKf7oqQIx25Efj8gEaKhqHU3i5S8IPj5Xqoh6dwFoL9kN5%2Fxy8P3u3Hbl9iZHT%2B%2FcoTBwxI6IBYZ2b9u8VfTB8cQ%2Fm4RktQMWJeDqqF%2BOwcuGx9dmS6GcU66Xab87Fu52zE8aZzULOgS4maozhMKLOt5v9j1A7ZkVAKLXSiWCysVI0aHjcjBjGbKJERx28JuRQq4v3lRGQ2ujMQGKq1cnEhyxYWXcvj5CMIGQWT8%2Bltt5VddJOmE%2BgdzBnRT6MNkB0qQZx7JkoJ%2BJ6TKu7NSroOx5zV0FCilK10uEoVxSe8UUMfrINNxKNmEWc7cJ9zrceou4q4RBVNzgK5A9PrRn%2FiE7A8grHTk9nuqIbhjuYLNO09gFzzgJQ6qVNkVRX0crJJldAMZ4gxZY1zSUWDqG5bxoTo82FrLM0G%2FttJIMNBuFNk4Rhyagp07DnP87vURU%2BEu1MNYpuZ%2BLPEzRd61fAvWNam%2FQhBWqQ0u2mQr6KoPJu5eay0pQL87nJAT%2BiiZBG74FOAmC5FICGJ0HV%2BprnDXOMMr5PWdoZgSiSfsHOFkDrZ%2B8ysff%2FrZxQCKrYiWR8enI0ryg8klGKsC67HJuC0i9Dpq3AmAvfcjG0j5ppKc3gBzSUaQNCquBv%2FcaonuSdwwuh4pAj%2B2%2BUSjU9ncVke8dlNlmuZTXlYW65Bvod1CUuIPUPPrvUi1BFnS6NBdHPKZqbEZQ8DeoTHZ0s%3D; path=/retrieve-and-rank/api; secure; HttpOnly
 < X-Client-IP: 88.157.199.114
 < X-Global-Transaction-ID: 260709032
 < Content-Type:
 < X-DP-Watson-Tran-ID: gateway-dp02-260709032
 <
 * Curl_http_done: called premature == 0
 * Connection #0 to host gateway.watsonplatform.net left intact

The message HTTP/1.1 405 Method Not Allowed means that we cannot perform this delete action. This is true or the curl command isn't correct?

By the way, do you know if it's possible to perform a 'delete all' operation/action?

Thanks!

2 Answers2

1

The curl request is looking good to me actually.
Unfortunately Solr doesn't provide you means to delete all synonyms. For more details you could see the following Managed Resources wiki page.

From what I see the problem is related to the proxy part of the whole end-to-end path. Here is why:

< HTTP/1.1 405 Method Not Allowed
< X-Backside-Transport: FAIL FAIL
< Allow: HEAD,POST,GET,OPTIONS

Which means that allowed methods are: HEAD, POST, GET, OPTIONS only. You need to tweak Watson or DW (whatever underlying framework is) is order to allow DELETE methods for the Solr's base path.

As a proof for that you could test synonyms delete by calling Solr directly instead of using proxy / orchestration layer.

Pavel Vasilev
  • 1,002
  • 1
  • 10
  • 11
1

Try to modify _schema_analysis_synonyms_en.json file in a /cores/../managed/. Restart is needed.

Yura
  • 1,733
  • 1
  • 20
  • 19