SearchResult()

This is the constructor method to create a SearchResult.

Invocation

SearchResult(query_result=None)

Return

A SearchResult object.

Attributes

PropertyDescription
iter(self)Iterate the search result. Each iteration returns a Hits corresponding to a query.
self[item]Return the Hits corresponding to the nth query
len(self)Return the nq of search result

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

Hits()

This is the constructor method to create a Hits object.

Invocation

Hits(hits)

Return

A Hits object.

Attributes

PropertyDescription
iter(self)Iterate the Hits object. Each iteration returns a Hit which represent a record corresponding to the query.
self[item]Return the kth Hit corresponding to the query
len(self)Return the number of hit record
idsReturn the primary keys of all search results
distancesReturn the distances of all hit record