未指定排序选项且未指定搜索查询时,弹性搜索如何排序 [英] How is Elastic Search sorting when no sort option specified and no search query specified

查看:85
本文介绍了未指定排序选项且未指定搜索查询时,弹性搜索如何排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道当未指定搜索查询(我仅对文档进行过滤)且未指定排序选项时,弹性搜索如何排序(在哪个字段上)。看起来排序不是随机的。默认排序顺序是_score,但是当您不指定搜索查询时,分数始终为1 ...

I wonder how Elastic search is sorting (on what field) when no search query is specified (I just filter on documents) and no sort option specified. It looks like sorting is than random ... Default sort order is _score, but score is always 1 when you do not specify a search query ...

推荐答案

您说对了。然后,它或多或少是随机的,得分为1。据我所记得,您仍然可以获得一致的结果。在SQL中获得结果时,您具有相同的意思,但不指定 ORDER BY

You got it right. Its then more or less random with score being 1. You still get consistent results as far as I remember. You have the "same" when you get results in SQL but don't specify ORDER BY.

这篇关于未指定排序选项且未指定搜索查询时,弹性搜索如何排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆