【发布时间】:2012-07-03 21:36:51
【问题描述】:
我遇到了一点弹性搜索问题。我是 elasticsearch 新手,不知道为什么这不起作用。
curl -XPOST 'http://myhost.nl:9200/my_index/test/_search?pretty=true' -d '{ "fields": ["message"] }'
我没有取回任何字段。 “消息”字段确实存在,并且看起来像弹性搜索网站上的示例。 http://www.elasticsearch.org/guide/reference/api/search/fields.html
谁能看到我错过了什么?
【问题讨论】:
-
您可以为您的测试类型添加映射定义吗?您可以通过运行 curl myhost.nl:9200/my_index/test/_mapping 来查找它
-
对不起,我不能为你美化它 {"test":{"properties":{"query":{"dynamic":"true","properties":{"query_string": {"dynamic":"true","properties":{"fields":{"type":"string"},"query":{"type":"string"}}},"querystring":{"动态":"true","properties":{"fields":{"type":"string"},"query":{"type":"string"}}}}},"tweet":{"动态":"true","properties":{"message":{"type":"string"},"post_date":{"type":"date","format":"dateOptionalTime"},"user ":{"type":"string"}}}}}}
标签: json elasticsearch