🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
< Docs
  • Python
    • SearchResult

Hit()

This is the constructor method to create a Hit object.

Invocation

Hit(hit)

Return

A Hit object.

Attributes

PropertyDescription
idsReturn the primary keys of the hit results
distancesReturn the distance between the hit record and the query
scoreReturn the score of the hit record. The score is set equal to distance.
strReturn the information of hit record

Examples

# hit is a Hit object

# gets the id of a hit entity
print(hit.ids)

# gets the distance of a entity from the query vector
print(hit.distances)

# gets the score of a hit entity
# should equal to the distance
print(hit.score)

# gets description of a hit entity
print(hit.str)

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?