mirror of https://github.com/milvus-io/milvus.git
feat(db): add search api for db
Former-commit-id: 593c7ef1ea7a37022773cf49d82bd2b16763f173pull/191/head
parent
fa33addbf7
commit
ee5d02939e
|
@ -29,6 +29,9 @@ public:
|
|||
virtual Status add_vectors(const std::string& group_id_,
|
||||
size_t n, const float* vectors, IDNumbers& vector_ids_) = 0;
|
||||
|
||||
virtual Status search(const std::string& group_id, size_t k, size_t nq,
|
||||
const float* vectors, QueryResults& results) = 0;
|
||||
|
||||
DB() = default;
|
||||
DB(const DB&) = delete;
|
||||
DB& operator=(const DB&) = delete;
|
||||
|
|
|
@ -52,6 +52,12 @@ Status DBImpl::add_vectors(const std::string& group_id_,
|
|||
}
|
||||
}
|
||||
|
||||
Status DBImpl::search(const std::string& group_id, size_t k, size_t nq,
|
||||
const float* vectors, QueryResults& results) {
|
||||
// PXU TODO
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
void DBImpl::start_timer_task(int interval_) {
|
||||
std::thread bg_task(&DBImpl::background_timer_task, this, interval_);
|
||||
bg_task.detach();
|
||||
|
|
|
@ -31,6 +31,9 @@ public:
|
|||
virtual Status add_vectors(const std::string& group_id_,
|
||||
size_t n, const float* vectors, IDNumbers& vector_ids_) override;
|
||||
|
||||
virtual Status search(const std::string& group_id, size_t k, size_t nq,
|
||||
const float* vectors, QueryResults& results) override;
|
||||
|
||||
virtual ~DBImpl();
|
||||
|
||||
private:
|
||||
|
|
|
@ -10,6 +10,9 @@ typedef long IDNumber;
|
|||
typedef IDNumber* IDNumberPtr;
|
||||
typedef std::vector<IDNumber> IDNumbers;
|
||||
|
||||
typedef std::vector<IDNumber> QueryResult;
|
||||
typedef std::vector<QueryResult> QueryResults;
|
||||
|
||||
|
||||
} // namespace engine
|
||||
} // namespace vecwise
|
||||
|
|
Loading…
Reference in New Issue