![](https://img-blog.csdnimg.cn/20191203144105856.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Elasticsearch
ample笔记
所有文章仅作学习交流,愿受指正。
展开
-
创建Index实例
try { CreateIndexRequestBuilder cib = client.admin().indices().prepareCreate(index); XContentBuilder mapping = XContentFactory.jsonBuilder().startObject().startObject("properties"); mapping.startO...原创 2020-04-30 16:06:33 · 379 阅读 · 0 评论 -
导出实例
SearchResponse scrollResp = client.prepareSearch(esIndex) .setIndicesOptions(IndicesOptions.fromOptions(true, true, false, false)) // 忽略不可用或不存在的index .setTypes(esType) .setSearchType(SearchType....原创 2020-04-30 15:46:22 · 243 阅读 · 0 评论 -
查询实例
SearchResponse response = client.prepareSearch(esIndex).setTypes(esType) .setIndicesOptions(IndicesOptions.fromOptions(true, true, false, false)) // 忽略不可用或不存在的index .setSearchType(SearchT...原创 2020-04-30 15:40:19 · 154 阅读 · 0 评论 -
调整window大小
es默认window大小是10000,当查询数据的起始点大于10000的时候,就需要调整window的值。 Settings settings = Settings.settingsBuilder().put(“index.max_result_window”, maxResultWindow).build(); UpdateSettingsRequest updateSettingsReques...原创 2020-04-30 15:37:08 · 443 阅读 · 0 评论