1) 端口錯
client = new TransportClient().addTransportAddress(new InetSocketTransportAddress(ipAddress, 9300));
這里9300 寫成9200的話會No node available
要是你連的不是本機,注意IP有沒有正確
2 )jar報引用版本不匹配,開啟的服務是什么版本,引用的jar最好匹配(這個我沒有去試,反正我的是匹配的)
3) 要是你改了集群名字,還有設置集群名字
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name", "xxx").build();
client = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(ipAddress, 9300));
可參考:
關於ES的Mappings設置可以參考如下文檔:
https://qbox.io/blog/set-analyzers-datatypes-default-mappings-elasticsearch
對date類型忽略檢查 可以有1月32日的這種情況
http://stackoverflow.com/questions/25257119/mapping-exception-when-indexing-in-elasticsearch