[Koha-bugs] [Bug 28610] New: Elasticsearch 7 - hits.total is now an object

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jun 22 11:24:51 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28610

            Bug ID: 28610
           Summary: Elasticsearch 7 - hits.total is now an object
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Searching - Elasticsearch
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: kevin.carnes at ub.lu.se

In Elasticsearch 7 hits.total is now an object
(https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#hits-total-now-object-search-response).

The total is now in $result->{hits}->{total}->{value} instead of
$result->{hits}->{total}.

There is also $result->{hits}->{total}->{relation} which specifies if the value
is exact or if it's a lower bound. So it's possible to say "Your search
returned > 10000 results."

You can always get an exact total by adding a track_total_hits parameter set to
true when using the Elasticsearch search method
(https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#track-total-hits-10000-default).

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list