一些es查询的资料

一种chrome es查询插件:Elasticvue

Elasticsearch复杂查询语法总结

NativeSearchQueryBuilder多条件查询方法 :不要连续使用多个withQuery,会会覆盖。

ES数组类型字段搜索以及数组空值搜索 :
每个字段都可以包含零个或多个值,但是所有值必须具有相同的数据类型。
e.g. : https://blog.csdn.net/asdksd/article/details/126750603

聚合查询:
Java Elasticsearch 聚合查询(Aggregation)详解
嵌套聚合:
ElasticSearch聚合查询小例子

解决聚合查询至多返回10个bucket的问题 :
关于在elasticSearch中使用聚合查询后只显示10个bucket的问题

TermsAggregationBuilder ab1 = AggregationBuilders.terms("groupByAreaLevel").field(arealLevelField).size(500) //不然顶多10个bucket

解决查询数据默认返回10条的问题:
在使用elasticsearch的rest api查询index数据时默认返回10条

NativeSearchQuery nativeSearchQuery = new NativeSearchQueryBuilder().withMaxResults(10000) //不然顶多返回10条
                        .withQuery(queryBuilder).build();

不过当我设置为更大的值,比如20000时报错了:
Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [20000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [20000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.]]
记录在此,暂不继续深入。

Elasticsearch Top hits Aggregation :
Elasticsearch Top hits Aggregation
ElasticSearch 学习笔记:聚合(Aggregation) - Top Hits:功能简介:
聚合后,每一个聚合Bucket里面仅返回指定顺序的前N条数据

你可能感兴趣的:(elasticsearch,prometheus,日志/监控,elasticsearch,es,es聚合)