\_total or \_totalMethod

By default, for all search requests Aidbox returns the total number in the result which represents how many resources matched the criteria. But to do this, we run the second query for the count which takes some additional time. Sometimes the count query is longer than your query.

To get a response faster you can change this behavior using the \_total (or \_totalMethod) parameter. The \_total parameter can have the following values:

  • nonedo not run count query (fastest)
  • estimateroughly estimate number of results (fast, additional request isEXPLAINrequest)
  • accuraterun accurate count (could be slow, additional request isCOUNT(\)request)

if you use _total=none you still get totalwhen you don't use _page and the number of returned resources is less than \_count & \_page (by default is 100).

Settings default \_total value

BOX_SEARCH_DEFAULT__PARAMS_TOTAL=<value>

Sets the default total search parameter value. value is one of: none, estimate, accurate.