feat: fetch() add output_fields param (#358)

This commit is contained in:
lichen2015
2026-05-27 22:58:49 +08:00
committed by GitHub
parent f336c5c955
commit e0ba23179b
13 changed files with 379 additions and 30 deletions
+15 -10
View File
@@ -271,16 +271,21 @@ void ZVecPyCollection::bind_dql_methods(
// return GroupResults
return unwrap_expected(result);
})
.def("Fetch",
[](const Collection &self, const std::vector<std::string> &pks) {
Result<DocPtrMap> result;
{
py::gil_scoped_release release;
result = self.Fetch(pks);
}
// return DocPtrMap
return unwrap_expected(result);
})
.def(
"Fetch",
[](const Collection &self, const std::vector<std::string> &pks,
const std::optional<std::vector<std::string>> &output_fields,
bool include_vector) {
Result<DocPtrMap> result;
{
py::gil_scoped_release release;
result = self.Fetch(pks, output_fields, include_vector);
}
// return DocPtrMap
return unwrap_expected(result);
},
py::arg("pks"), py::arg("output_fields") = py::none(),
py::arg("include_vector") = true)
.def(
"_debug_hnsw_storage_mode",
[](const Collection &self, const std::string &column_name) {