1.在外部通过9200能成功的访问docker容器里面的ES
2.在application里面配置相应的属性
节点的名字,节点的地址(注意:节点的地址是9300)
节点的名字是在外部访问9200时的cluster_name的名字
节点的地址是虚拟机的ip:9300
注意springBoot的版本与ES的版本适配问题:
https://docs.spring.io/spring-data/elasticsearch/docs/4.0.3.RELEASE/reference/html/#new-features
ES的相关应用:
https://github.com/spring-projects/spring-data-elasticsearch
ES的查询方法命名规则:
https://docs.spring.io/spring-data/elasticsearch/docs/4.0.3.RELEASE/reference/html/#elasticsearch.query-methods