Skip to content

Commit 43c71ce

Browse files
committed
Refer to hits.total.relation and value in docs
Fixes #1172 Thank you, federicotdn!
1 parent d8d0c47 commit 43c71ce

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/faceted_search.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ Example
145145
response = bs.execute()
146146
147147
# access hits and other attributes as usual
148-
print(response.hits.total, 'hits total')
148+
total = response.hits.total
149+
print('total hits', total.relation, total.value)
149150
for hit in response:
150151
print(hit.meta.score, hit.title)
151152

docs/search_dsl.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,10 @@ convenient helpers:
507507
print(response.took)
508508
# 12
509509
510-
print(response.hits.total)
510+
print(response.hits.total.relation)
511+
# eq
512+
print(response.hits.total.value)
513+
# 142
511514
512515
print(response.suggest.my_suggestions)
513516

0 commit comments

Comments
 (0)