简体   繁体   English

搜索结果不包含该页面的所有匹配

[英]Search result does not contain all hits for page

Doing a fairly standard search query on my ElasticSearch index: 对我的ElasticSearch索引执行相当标准的搜索查询:

GET /myIndex/myType/_search?q=nameEnglish:stir

I get a response like: 我得到的答复是:

{
    "hits": {
        "total": 2,
        "max_score": 1.8492403,
        "hits": [...1 object...]
    },
    "_shards": {
        "total": 1,
        "successful": 1,
        "failed": 0
    },
    "timed_out": false,
    "took": 1
}

So, it's telling me there were two matches, but it's only returning one. 所以,这告诉我有两场比赛,但只返回了一场。 If I want to get the other hit I have to run the query with &from=1 . 如果我想获得另一个匹配,我必须使用&from=1来运行查询。 As I understand it, the default page size for ElasticSearch is 10 records, so why is it only returning 1? 据我了解,ElasticSearch的默认页面大小是10条记录,那么为什么它只返回1?

Adding a &size= parameter doesn't affect the result. 添加&size=参数不会影响结果。 I can also reproduce this with other queries (ie the number of "hits" returned being less than the page size), and the number of records returned will vary depending on whether I add a sort parameter to the query. 我还可以在其他查​​询中重现此信息(即,返回的“匹配”数小于页面大小),并且返回的记录数将根据是否向查询添加排序参数而有所不同。

I'm testing this on a Searchly -hosted ES index. 我正在以Searchly托管的ES索引上对此进行测试。

With default configuration of ES 1.2.1 (Win), you get 5 hits when I try your query. 使用ES 1.2.1(Win)的默认配置,当我尝试查询时,您会获得5次匹配。 Perhaps it is in the configuration of Searchly. 也许是在Searchly的配置中。

Try to query with the POST request. 尝试使用POST请求进行查询。 The answer should have the header similar (max 5 successful), but you should receive 10 (or more) resonses depending on the size parameter. 答案的标题应该相似(最多成功5个),但是您应该收到10个(或更多)共振,具体取决于size参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 弹性搜索如何显示查询的所有命中 - how do elastic search show all the hits for query 当卷曲请求执行时,Rails弹性搜索不返回任何命中 - Rails Elastic Search Returns No Hits While Curl Request Does 当field是对象时,elasticsearch不会返回所有匹配 - elasticsearch does not return all hits when field is an object ElasticSearch.net 附件搜索数组返回所有带有搜索结果的附件如何仅检索命中 - ElasticSearch.net Array of Attachment Search is returning all attachments with search results how to retrieve only hits Shopware 6 - 弹性搜索和搜索结果页面 - Shopware 6 - elastic search and search result page 如何搜索特定字段包含一个列表中的所有项目但不包含另一个列表中的任何项目的文档? - How to search for documents whose specific field contains all items from one list and does not contain any item from another list? 使用angularjs的elasticsearch无论我搜索什么,它总是命中数据库中的所有数据 - elasticsearch with angularjs no matter what I search, it always hits all data in the database 使用 min_doc_count=0 的弹性搜索聚合返回所有与查询结果或命中无关的存储桶 - Elastic search aggregation using min_doc_count=0 returns all the buckets which are not related to query results or hits 按顶部命中聚合的结果分组 - Group by result of top hits aggregation 部分搜索返回零命中 - Partial search return zero hits
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM