一些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条数据

相关推荐

  1. 一些es查询资料

    2023-12-08 04:38:04       41 阅读
  2. es聚合查询(二)

    2023-12-08 04:38:04       14 阅读
  3. es6一些方法

    2023-12-08 04:38:04       14 阅读
  4. Python如何查询es数据

    2023-12-08 04:38:04       17 阅读
  5. ES6一些高级技巧

    2023-12-08 04:38:04       31 阅读

最近更新

  1. TCP协议是安全的吗?

    2023-12-08 04:38:04       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-08 04:38:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-08 04:38:04       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-08 04:38:04       20 阅读

热门阅读

  1. IoU、GIoU、CIoU和DIoU

    2023-12-08 04:38:04       29 阅读
  2. php中WebSocket简单使用

    2023-12-08 04:38:04       36 阅读
  3. 不修改数据库更换WordPress域名

    2023-12-08 04:38:04       36 阅读
  4. 汽车标定技术(十)--从CPU角度观察Overlay实现原理

    2023-12-08 04:38:04       38 阅读
  5. Docker 一些设置

    2023-12-08 04:38:04       39 阅读
  6. 服务器如何修改密码

    2023-12-08 04:38:04       37 阅读
  7. 《路由与交换技术》读书笔记

    2023-12-08 04:38:04       34 阅读
  8. 通过Python Flask快速构建应用程序

    2023-12-08 04:38:04       36 阅读
  9. 删除容器挂载卷打包容器镜像并传到阿里云

    2023-12-08 04:38:04       37 阅读
  10. What is John Deere diagnostic software called?

    2023-12-08 04:38:04       31 阅读
  11. Uni-App知识点

    2023-12-08 04:38:04       35 阅读
  12. STL-空间配置器

    2023-12-08 04:38:04       34 阅读
  13. react(2) - react-redux的基本使用

    2023-12-08 04:38:04       39 阅读