我们正尝试使用以下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命令不正确?
顺便说一句,您知道是否可以执行“全部删除”操作。操作/动作?
谢谢!
答案 0 :(得分:0)
curl
请求实际上对我很好
不幸的是,Solr没有为您提供删除所有同义词的方法。有关详细信息,您可以看到以下Managed Resources Wiki页面。
从我看到的问题是与整个端到端路径的代理部分有关。原因如下:
< HTTP/1.1 405 Method Not Allowed
< X-Backside-Transport: FAIL FAIL
< Allow: HEAD,POST,GET,OPTIONS
这意味着允许的方法仅限于:HEAD
,POST
,GET
,OPTIONS
。
您需要调整Watson或DW(无论底层框架是什么),以便为Solr的基本路径提供DELETE
方法。
作为证据,您可以通过直接调用Solr而不是使用代理/编排层来测试同义词删除。
答案 1 :(得分:0)
尝试在 / cores /../ managed / 中修改 _schema_analysis_synonyms_en.json 文件。需要重新启动。