elasticsearch - Elasticsearch 分片请求缓存中的 size=0 是什么意思?
问题描述
By default, the requests cache will only cache the results of search requests where size=0, so it will not cache hits, but it will cache hits.total, aggregations, and suggestions.
我不明白声明的部分:“size=0”。
这里的大小上下文/含义是什么?
这是否意味着结果缓存将
- 只缓存空结果?
- 仅缓存第 1 页(我认为默认 10 个结果)?
解决方案
不,如果您想获取不同于 10 的结果,大小参数很有用,因为默认大小为 10,因此如果您使用需要获取的搜索查询,假设 1000 个结果,而不是将大小参数指定为 1000,而无需这样您将只获得前 10 个搜索结果,并按其分数降序排列。
size=0,在分片请求缓存中,它不会缓存确切的结果(即带有分数的文档数量),而只会缓存结果总数(即 hits.total)等元数据。
推荐阅读
- python - 将两个连续字符之一保留在字符串中
- python - Matplotlib python Bar Plot:如何仅显示月份而不是在matplotlib中显示条形图的日期?
- json - 将数据传递给水平条 Highchart.js,在 codeigniter 中只显示一条记录
- algorithm - 寻找两个凸多面体交集的算法
- java - 使用 ApplicationContext 运行 JUnit 测试时禁用 Hazelcast 实例
- bash - Linux管道重定向到文件
- c# - 我希望 MS Access 中最后一条记录的相应 ID 出现在消息框内
- javascript - 根据按钮的id切换按钮动作
- autohotkey - 监视器关闭时 AHK 脚本空闲
- python - 如何在 Tkinter 中制作标签只获得空白空间而不是整个窗口