一、Fielddata is disabled on text fields by default. Set fielddata=true on [name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.
原因:fielddata=true未开启,在ElasticSearch中默认fielddata默认是false的,因为开启Text的fielddata后对内存的占用很高
解决方法
curl -i -H "Content-Type:application/json" -XPUT 127.0.0.1:9200/zipkin:span-2019-05-16/_mapping/span/?pretty -d'{"span":{"properties":{"name":{"type":"text","fielddata":true}}}}'
二、localhost连接成功,通过IP连接却失败。
修改配置文件elasticsearch.yml
network.host: 0.0.0.0
另外说明,配置子文件地址
mac 6.5版本
/usr/local/etc/elasticsearch/elasticsearch.yml
mac 2.4.1版本
/usr/local/Cellar/elasticsearch-2.4.1/config/elasticsearch.yml