我正在尝试将 _analyze api 与如下所示的文本一起使用:
--- some -- text ---
此请求按预期工作:
curl localhost:9200/my_index/_analyze -d '--'
{"tokens":[]}
但是,这个失败了:
curl localhost:9200/medical_documents/_analyze -d '---'
---
error:
root_cause:
- type: "illegal_argument_exception"
reason: "Malforrmed content, must start with an object"
type: "illegal_argument_exception"
reason: "Malforrmed content, must start with an object"
status: 400
考虑到响应的格式,我假设 elasticsearch 尝试将请求解析为 yaml 并失败。
如果是这种情况,我如何禁用 yml 解析或_analyze
以 开头的文本---
?