Skip to content

fetch_size: head command does not correctly reflect total hits or override fetch_size #5191

Description

@ahkcs

Description

When using the fetch_size API (default fetch_size = 500), the result status bar does not correctly display the total document count in certain head command scenarios. Both cases below are bugs — the status should always reflect the total number of hits, not just the number of documents retrieved by the query.

Related PR: #5109

Bug 1: head N where N < fetch_size

Example: head 200 with default fetch_size = 500

  • Current behavior: Shows 200 of 200 results
  • Expected behavior: Should show 200 results

The status should reflect how many total documents match the query, not just how many were returned.

Bug 2: head N where N > fetch_size

Example: head 600 with default fetch_size = 500

  • Current behavior: Shows 500 of 600 results
  • Expected behavior: Should show 600 of {total_hits} results

When the user-specified head value exceeds the default fetch_size, the head value should override fetch_size so that all requested rows are returned.

Summary of Expected Behavior

  • The result status should always show the total document count (total hits), not just the number of documents retrieved from the query.
  • If head value > fetch_size, the head value should override fetch_size.
  • If head value < fetch_size, the status should show head_value of total_hits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PPLPiped processing languagebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions