MCPcopy Create free account
hub / github.com/alibaba/zvec / _execute_single_query

Method _execute_single_query

python/zvec/executor/query_executor.py:134–144  ·  view source on GitHub ↗

Single/vector-less query: send a ``_SearchQuery`` to C++. Results are batch-materialized into tuples in a single C++ call (the schema is resolved inside the binding from the collection), avoiding per-doc Python/C++ crossings on the hot path.

(
        self, query: _SearchQuery, collection: _Collection
    )

Source from the content-addressed store, hash-verified

132 return self._execute_multi_query(ctx, queries, collection)
133
134 def _execute_single_query(
135 self, query: _SearchQuery, collection: _Collection
136 ) -> DocList:
137 """Single/vector-less query: send a ``_SearchQuery`` to C++.
138
139 Results are batch-materialized into tuples in a single C++ call
140 (the schema is resolved inside the binding from the collection),
141 avoiding per-doc Python/C++ crossings on the hot path.
142 """
143 tuples = collection.Query(query)
144 return [Doc._from_tuple(t) if t is not None else None for t in tuples]
145
146 def _execute_multi_query(
147 self, ctx: QueryContext, queries: list[_SearchQuery], collection: _Collection

Callers 3

executeMethod · 0.95

Calls 1

_from_tupleMethod · 0.80