Skip to content

Using instant search with hitsPerPage = 0 returns 1 result #1365

Open
@8byr0

Description

@8byr0

Description
Using <Configure hitsPerPage={0} /> is tranformed to { "limit": 1 } in the request sent to meilisearch therefore returning 1 hit when 0 have been requested.

Expected behavior
Choosing 0 hits per page should set the limit to 0 in generated ms request

Seems to come from

pagination adapter :

const { limit = 20, offset = 0, hits } = searchResponse
const additionalPage = hits.length >= limit ? 1 : 0
return offset / hitsPerPage + 1 + additionalPage
}

search params adapter

return {
limit: hitsPerPage + 1,
offset: page * hitsPerPage,
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions