mirror of
https://gitee.com/dromara/easy-es.git
synced 2025-12-08 01:59:18 +08:00
docs: 添加 Easysearch 官网链接并优化 easy-es-sample 示例代码
This commit is contained in:
parent
f2eee40e5f
commit
d897b2fdc3
@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
**开源社区码云首页** https://gitee.com/dromara/
|
**开源社区码云首页** https://gitee.com/dromara/
|
||||||
|
|
||||||
|
**Easysearch官网** https://www.infinilabs.cn/products/easysearch/
|
||||||
|
|
||||||
[Easy-Es-PPT下载](https://iknow.hs.net/21df32cf-35fb-44f0-945f-06330408c1bd.pptx)
|
[Easy-Es-PPT下载](https://iknow.hs.net/21df32cf-35fb-44f0-945f-06330408c1bd.pptx)
|
||||||
|
|
||||||
> **Tip:** 官网是vue单页面应用,且服务部署在🇺🇸,国内用户首次访问加载可能比较慢🐢,主公们请耐心等待一下,后续会很快🏹,如偶遇打不开可刷新多尝试几次,或尝试魔法上网.
|
> **Tip:** 官网是vue单页面应用,且服务部署在🇺🇸,国内用户首次访问加载可能比较慢🐢,主公们请耐心等待一下,后续会很快🏹,如偶遇打不开可刷新多尝试几次,或尝试魔法上网.
|
||||||
@ -42,11 +44,11 @@
|
|||||||
# 简介 | Intro
|
# 简介 | Intro
|
||||||
---
|
---
|
||||||
|
|
||||||
Easy-Es for Easysearch 是一款简化 INFINI Easysearch 搜索引擎操作的开源框架,全自动智能索引托管.
|
Easy-Es for Easysearch 是一款简化 INFINI [Easysearch](https://www.infinilabs.cn/products/easysearch/) 搜索引擎操作的开源框架,全自动智能索引托管.
|
||||||
|
|
||||||
Easysearch 是一个轻量级且自主可控的 国产化搜索引擎。
|
[Easysearch](https://www.infinilabs.cn/products/easysearch/) 是一个轻量级且自主可控的 国产化搜索引擎。
|
||||||
|
|
||||||
Easy-Es for Easysearch 是国内首家专门针对 Easysearch 客户端简化的工具。
|
Easy-Es for Easysearch 是国内首家专门针对 [Easysearch](https://www.infinilabs.cn/products/easysearch/) 客户端简化的工具。
|
||||||
|
|
||||||
简化`CRUD`及其它高阶操作,可以更好的帮助开发者减轻开发负担
|
简化`CRUD`及其它高阶操作,可以更好的帮助开发者减轻开发负担
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import org.dromara.easyes.core.conditions.select.LambdaEsQueryWrapper;
|
|||||||
import org.dromara.easyes.sample.entity.Document;
|
import org.dromara.easyes.sample.entity.Document;
|
||||||
import org.dromara.easyes.sample.mapper.DocumentMapper;
|
import org.dromara.easyes.sample.mapper.DocumentMapper;
|
||||||
import org.easysearch.action.search.SearchResponse;
|
import org.easysearch.action.search.SearchResponse;
|
||||||
|
import org.easysearch.search.aggregations.Aggregations;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -12,7 +13,7 @@ import javax.annotation.Resource;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import org.easysearch.search.aggregations.Aggregations;
|
||||||
|
|
||||||
/**l
|
/**l
|
||||||
* 演示springboot项目实际使用
|
* 演示springboot项目实际使用
|
||||||
@ -114,16 +115,16 @@ public class SampleController {
|
|||||||
/**
|
/**
|
||||||
* 聚合查询 - 按创建时间和点赞数分组统计
|
* 聚合查询 - 按创建时间和点赞数分组统计
|
||||||
*
|
*
|
||||||
* @return SearchResponse 聚合结果
|
* @return Aggregations 聚合结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/aggByDateAndStar")
|
@GetMapping("/aggByDateAndStar")
|
||||||
public SearchResponse aggByDateAndStar() {
|
public Aggregations aggByDateAndStar() {
|
||||||
LambdaEsQueryWrapper<Document> wrapper = new LambdaEsQueryWrapper<>();
|
LambdaEsQueryWrapper<Document> wrapper = new LambdaEsQueryWrapper<>();
|
||||||
// 按创建时间分组,并在每个时间组内按点赞数分组(链式聚合)
|
// 按创建时间分组,并在每个时间组内按点赞数分组(链式聚合)
|
||||||
wrapper.groupBy(Document::getGmtCreate)
|
wrapper.groupBy(Document::getGmtCreate)
|
||||||
.max(Document::getStarNum)
|
.max(Document::getStarNum)
|
||||||
.min(Document::getStarNum);
|
.min(Document::getStarNum);
|
||||||
SearchResponse response = documentMapper.search(wrapper);
|
SearchResponse response = documentMapper.search(wrapper);
|
||||||
return response;
|
return response.getAggregations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user