0

我们正在尝试使用以下 curl 命令删除同义词。

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"

我们得到的结果是:

 *   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

该消息HTTP/1.1 405 Method Not Allowed意味着我们无法执行此删除操作。这是真的还是 curl 命令不正确?

顺便说一句,您知道是否可以执行“全部删除”操作/操作?

谢谢!

4

2 回答 2

1

实际上,这个curl请求对我来说看起来不错。
不幸的是,Solr 没有为您提供删除所有同义词的方法。有关更多详细信息,您可以查看以下托管资源wiki 页面。

据我所知,问题与整个端到端路径的代理部分有关。原因如下:

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

这意味着允许的方法是:HEAD, POST, GET, OPTIONSonly。您需要调整 Watson 或 DW(无论底层框架是什么),以便允许DELETESolr 基本路径的方法。

作为证明,您可以通过直接调用 Solr 而不是使用代理/编排层来测试同义词删除。

于 2016-10-26T09:59:17.007 回答
1

尝试修改/cores/../managed/中的_schema_analysis_synonyms_en.json文件。需要重新启动。

于 2020-01-22T14:09:36.923 回答