Skip to content

ReactiveSearch: Total hits returns to default 10000 after 'size' props changes  #1939

@allendol

Description

@allendol

Affected Projects
ReactiveSearch

Describe the bug
I set defaultQuery as below
defaultQuery={props => ({
track_total_hits: true
})}
Now I get the correct total hits which is more than default 10000,
But when the 'size' property is changed in my ReactiveSearch code, defaultQuery doesn't work and total hits goes back 10000.
I saw in other thread to pass ?rest_total_hits_as_int=true in request parameter. But I don't know how and where.
Any sample code is appreciated.

To Reproduce
<ReactiveList
dataField="main_no" /
componentId="Result01"
react={{
and: ["Main No"],
}}
pagination={true}
paginationAt="both"
showResultStats={true}
size={this.state.selectedRow.value}
defaultQuery={() => {
return { track_total_hits: true };
}}
preserveResults={true}
render={(this.state.selectedOption.value === 'eval') ? this.ReactiveList : this.ReactiveList2}
onPageChange={
this.hideid
}
style={{
padding: "0.015625em",
}}
/>
Steps to reproduce the behavior:
Change the size from the interface
Expected behavior
Total number of results should not be changed to default value:10000

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions