diff --git a/.github/workflows/nightly_ci.yml b/.github/workflows/nightly_ci.yml index e252893a..110f43f9 100644 --- a/.github/workflows/nightly_ci.yml +++ b/.github/workflows/nightly_ci.yml @@ -36,7 +36,9 @@ jobs: id: extracter working-directory: ci/scripts run: | - echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV + url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX" + echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV +# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV # echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" - name: Create cluster @@ -94,7 +96,9 @@ jobs: id: extracter working-directory: ci/scripts run: | - echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV + url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX" + echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV +# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV # echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" - name: Create cluster @@ -152,7 +156,9 @@ jobs: id: extracter working-directory: ci/scripts run: | - echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV + url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX" + echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV +# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV # echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" - name: Create cluster diff --git a/.github/workflows/test-ci.yaml b/.github/workflows/test-ci.yaml index 4c7cd1c9..9cc05f2b 100644 --- a/.github/workflows/test-ci.yaml +++ b/.github/workflows/test-ci.yaml @@ -36,7 +36,9 @@ jobs: shell: bash working-directory: ci/scripts run: | - echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV + url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX" + echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV +# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV # export IMAGE_TAG=$IMAGE_TAG # export IMAGE_REPO=$IMAGE_REPO # export RELEASE_NAME=$RELEASE_NAME diff --git a/client/ann_request.go b/client/ann_request.go index df88aa47..26f7b61a 100644 --- a/client/ann_request.go +++ b/client/ann_request.go @@ -20,11 +20,12 @@ type ANNSearchRequest struct { limit int } -func NewANNSearchRequest(fieldName string, metricsType entity.MetricType, vectors []entity.Vector, searchParam entity.SearchParam, limit int, options ...SearchQueryOptionFunc) *ANNSearchRequest { +func NewANNSearchRequest(fieldName string, metricsType entity.MetricType, expr string, vectors []entity.Vector, searchParam entity.SearchParam, limit int, options ...SearchQueryOptionFunc) *ANNSearchRequest { return &ANNSearchRequest{ fieldName: fieldName, vectors: vectors, metricType: metricsType, + expr: expr, searchParam: searchParam, limit: limit, options: options, diff --git a/test/testcases/groupby_search_test.go b/test/testcases/groupby_search_test.go index 56d3e5ab..5902057e 100644 --- a/test/testcases/groupby_search_test.go +++ b/test/testcases/groupby_search_test.go @@ -193,7 +193,7 @@ func TestSearchGroupByBinaryDefault(t *testing.T) { for _, groupByField := range supportedGroupByFields { _, err := mc.Search(ctx, collName, []string{}, "", []string{common.DefaultVarcharFieldName, groupByField}, queryVec, common.DefaultBinaryVecFieldName, metricType, common.DefaultTopK, sp, client.WithGroupByField(groupByField)) - common.CheckErr(t, err, false, "Unsupported dataType for chunk brute force iterator:VECTOR_BINARY") + common.CheckErr(t, err, false, "not support search_group_by operation based on binary vector column") } } } @@ -237,7 +237,7 @@ func TestSearchGroupByBinaryGrowing(t *testing.T) { _, err := mc.Search(ctx, collName, []string{}, "", []string{common.DefaultVarcharFieldName, groupByField}, queryVec, common.DefaultBinaryVecFieldName, metricType, common.DefaultTopK, sp, client.WithGroupByField(groupByField), client.WithSearchQueryConsistencyLevel(entity.ClStrong)) - common.CheckErr(t, err, false, "Unsupported dataType for chunk brute force iterator:VECTOR_BINARY") + common.CheckErr(t, err, false, "not support search_group_by operation based on binary vector column") } } } @@ -335,8 +335,7 @@ func TestSearchGroupByUnsupportedIndex(t *testing.T) { _, err := mc.Search(ctx, collName, []string{}, "", []string{common.DefaultIntFieldName, common.DefaultVarcharFieldName}, queryVec, common.DefaultFloatVecFieldName, entity.MetricType(idx.Params()["metrics_type"]), common.DefaultTopK, sp, client.WithGroupByField(common.DefaultVarcharFieldName)) - common.CheckErr(t, err, false, "trying to groupBy on unsupported index type will fail, "+ - "currently only support ivf-flat, ivf_cc and HNSW") + common.CheckErr(t, err, false, "doesn't support search_group_by") } } diff --git a/test/testcases/index_test.go b/test/testcases/index_test.go index 10114324..91ac450a 100644 --- a/test/testcases/index_test.go +++ b/test/testcases/index_test.go @@ -160,7 +160,7 @@ func TestCreateIndexJsonField(t *testing.T) { // create vector index on json field idx, _ := entity.NewIndexHNSW(entity.L2, 8, 96) err := mc.CreateIndex(ctx, collName, common.DefaultJSONFieldName, idx, false, client.WithIndexName("json_index")) - common.CheckErr(t, err, false, "create index on JSON field is not supported") + common.CheckErr(t, err, false, "only support float vector or binary vector") // create scalar index on json field //err = mc.CreateIndex(ctx, collName, common.DefaultJSONFieldName, entity.NewScalarIndex(), false, client.WithIndexName("json_index")) @@ -194,10 +194,10 @@ func TestCreateIndexArrayField(t *testing.T) { if field.DataType == entity.FieldTypeArray { // create scalar index err := mc.CreateIndex(ctx, collName, field.Name, scalarIdx, false, client.WithIndexName("scalar_index")) - common.CheckErr(t, err, false, "create index on Array field is not supported: invalid parameter") + common.CheckErr(t, err, false, "create auto index on Array field is not supported") // create vector index err1 := mc.CreateIndex(ctx, collName, field.Name, vectorIdx, false, client.WithIndexName("vector_index")) - common.CheckErr(t, err1, false, "create index on Array field is not supported: invalid parameter") + common.CheckErr(t, err1, false, "float or float16 or bfloat16 vector are only supported") } } } @@ -390,12 +390,12 @@ func TestCreateIndexNotSupportedField(t *testing.T) { // create index idx, _ := entity.NewIndexHNSW(entity.L2, 8, 96) err := mc.CreateIndex(ctx, collName, common.DefaultFloatFieldName, idx, false) - common.CheckErr(t, err, false, "index type not match") + common.CheckErr(t, err, false, "only support float vector or binary vector") // create scann index indexScann, _ := entity.NewIndexSCANN(entity.L2, 8, true) err = mc.CreateIndex(ctx, collName, common.DefaultFloatFieldName, indexScann, false) - common.CheckErr(t, err, false, "index type not match") + common.CheckErr(t, err, false, "float or float16 or bfloat16 vector are only supported") } // test create index with invalid params diff --git a/test/testcases/search_test.go b/test/testcases/search_test.go index 1d5f0349..cb37c59a 100644 --- a/test/testcases/search_test.go +++ b/test/testcases/search_test.go @@ -604,7 +604,6 @@ func TestSearchInvalidVectorField(t *testing.T) { } // test search with invalid vectors -// TODO Issue https://github.com/milvus-io/milvus-sdk-go/issues/377 func TestSearchInvalidVectors(t *testing.T) { t.Parallel() ctx := createContext(t, time.Second*common.DefaultTimeout*2) @@ -628,7 +627,7 @@ func TestSearchInvalidVectors(t *testing.T) { {vectors: common.GenSearchVectors(common.DefaultNq, 64, entity.FieldTypeFloatVector), errMsg: "vector dimension mismatch"}, // vector type not match - {vectors: common.GenSearchVectors(common.DefaultNq, common.DefaultDim, entity.FieldTypeBinaryVector), errMsg: "vector dimension mismatch"}, + {vectors: common.GenSearchVectors(common.DefaultNq, common.DefaultDim, entity.FieldTypeBinaryVector), errMsg: "vector type must be the same"}, // empty vectors {vectors: []entity.Vector{}, errMsg: "nq [0] is invalid"}, @@ -1375,6 +1374,7 @@ func TestRangeSearchScannIPCosine(t *testing.T) { // test range search with scann index and entity.HAMMING, entity.JACCARD metric type func TestRangeSearchScannBinary(t *testing.T) { + t.Skip("https://github.com/milvus-io/milvus-sdk-go/issues/693") t.Parallel() for _, metricType := range common.SupportBinIvfFlatMetricType { ctx := createContext(t, time.Second*common.DefaultTimeout)