Skip to content

Commit c0a013b

Browse files
committed
Add total hits relation in result selt
1 parent 61a8ba5 commit c0a013b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Elastica/ResultSet.php

+10
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ public function getTotalHits()
160160
return (int) ($data['hits']['total']['value'] ?? 0);
161161
}
162162

163+
/**
164+
* Returns the total number relation of found hits.
165+
*/
166+
public function getTotalHitsRelation(): string
167+
{
168+
$data = $this->_response->getData();
169+
170+
return $data['hits']['total']['relation'] ?? 'eq';
171+
}
172+
163173
/**
164174
* Returns the max score of the results found.
165175
*

0 commit comments

Comments
 (0)