i would like to know if there is a way to get the number of documents i have added to an index in marqo, i have been adding docmunts to two different index but right now i don't know how many documents i have added to each. i tried doing this:
import marqo
mq = marqo.Client(url='http://localhost:8882')
first_index = mq.index("first-index").search(
q="any_query"
limit=100
)
second_index = mq.index("second-index").search(
q="any_query"
limit=100
)
print(len(first_index['hits']))
print(len(second_index['hits']))
this works because i know that the number of documents i have added is not upto 100. i would like to know if there is a more efficient way of getting the number of documents
you can use the
get_stats()
method for that eg;output;