- 2023-06-23match_all 查询所有【ElasticSearch】
/***match_all查询所有*/@Testpublicvoidtest02()throwsIOException{SearchRequestsearchRequest=newSearchRequest("hotel");SearchSourceBuildersearchSourceBuilder=newSearchSourceBuilder();
- 2023-06-23rang 范围查询【ElasticSearch】
/***rang范围查询*/@Testpublicvoidtest04()throwsIOException{SearchRequestsearchRequest=newSearchRequest();SearchSourceBuildersearchSourceBuilder=newSearchSourceBuilder();searchSourceBuilder
- 2023-06-23term 精确查询【ElasticSearch】
/***term精确查询*/@Testpublicvoidtest03()throwsIOException{SearchRequestsearchRequest=newSearchRequest();SearchSourceBuildersearchSourceBuilder=newSearchSourceBuilder();searchSourceBuilder.
- 2022-12-09Java操作ElasticSearch(四、排序、高亮、分页、Filter过滤、source筛选)
排序通过SearchSourceBuilder的sort(String,SortOrder)方法用来实现排序条件的封装@Testpublicvoidtest18()throwsIOException{SearchRequestrequest
- 2022-12-08Java操作ElasticSearch(三、查询)
查询的步骤如下创建SearchSourceBuilder对象添加查询条件QueryBuilders添加排序、分页等其他条件创建SearchRequest对象,并指定索引库名称发起请求,得到结果获取