From 592dde4dd7e38f99ed2431616d4c0a7521a38c34 Mon Sep 17 00:00:00 2001 From: groot Date: Mon, 29 Apr 2019 16:12:35 +0800 Subject: [PATCH] add attribute for vector Former-commit-id: c2a1a5cd917abe1cf3e8ef327bba5c2ed1cf8008 --- cpp/src/thrift/VectorService.thrift | 7 +++++-- cpp/src/thrift/gen-cpp/VecService.h | 7 +++++-- cpp/src/thrift/gen-cpp/VecService_server.skeleton.cpp | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cpp/src/thrift/VectorService.thrift b/cpp/src/thrift/VectorService.thrift index 442b612f1a..36bab9c69f 100644 --- a/cpp/src/thrift/VectorService.thrift +++ b/cpp/src/thrift/VectorService.thrift @@ -100,8 +100,11 @@ service VecService { /** * search interfaces - * if time_range_list is empty, engine will search without time limit - * + * you can use filter to reduce search result + * filter.attrib_filter can specify which attribute you need, for example: + * set attrib_filter = {"color":""} means you want to get "color" attribute for result vector + * set attrib_filter = {"color":"red"} means you want to get vectors which has attribute "color" equals "red" + * if filter.time_range is empty, engine will search without time limit */ VecSearchResult search_vector(2: string group_id, 3: i64 top_k, 4: VecTensor tensor, 5: VecSearchFilter filter) throws(1: VecException e); VecSearchResultList search_vector_batch(2: string group_id, 3: i64 top_k, 4: VecTensorList tensor_list, 5: VecSearchFilter filter) throws(1: VecException e); diff --git a/cpp/src/thrift/gen-cpp/VecService.h b/cpp/src/thrift/gen-cpp/VecService.h index 7d2ab677d3..d1bfc68d9d 100644 --- a/cpp/src/thrift/gen-cpp/VecService.h +++ b/cpp/src/thrift/gen-cpp/VecService.h @@ -45,8 +45,11 @@ class VecServiceIf { /** * search interfaces - * if time_range_list is empty, engine will search without time limit - * + * you can use filter to reduce search result + * filter.attrib_filter can specify which attribute you need, for example: + * set attrib_filter = {"color":""} means you want to get "color" attribute for result vector + * set attrib_filter = {"color":"red"} means you want to get vectors which has attribute "color" equals "red" + * if filter.time_range is empty, engine will search without time limit * * @param group_id * @param top_k diff --git a/cpp/src/thrift/gen-cpp/VecService_server.skeleton.cpp b/cpp/src/thrift/gen-cpp/VecService_server.skeleton.cpp index 2e29eb1fbb..8cd2e03b16 100644 --- a/cpp/src/thrift/gen-cpp/VecService_server.skeleton.cpp +++ b/cpp/src/thrift/gen-cpp/VecService_server.skeleton.cpp @@ -67,8 +67,11 @@ class VecServiceHandler : virtual public VecServiceIf { /** * search interfaces - * if time_range_list is empty, engine will search without time limit - * + * you can use filter to reduce search result + * filter.attrib_filter can specify which attribute you need, for example: + * set attrib_filter = {"color":""} means you want to get "color" attribute for result vector + * set attrib_filter = {"color":"red"} means you want to get vectors which has attribute "color" equals "red" + * if filter.time_range is empty, engine will search without time limit * * @param group_id * @param top_k