Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Search fails with filter expression contains underscore #38068

Closed
1 task done
yhmo opened this issue Nov 28, 2024 · 6 comments
Closed
1 task done

[Bug]: Search fails with filter expression contains underscore #38068

yhmo opened this issue Nov 28, 2024 · 6 comments
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@yhmo
Copy link
Contributor

yhmo commented Nov 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: 2.4.16
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

from pymilvus import (
    connections,
    FieldSchema, CollectionSchema, DataType,
    Collection,
    utility,
)
import random

HOST = '127.0.0.1'
PORT = '19530'

connections.connect(host=HOST, port=PORT)
print(utility.get_server_version())

collection_name = "AAA"
dim = 128

fields = [
    FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, auto_id=False),
    FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=dim),
    FieldSchema(name="var", dtype=DataType.VARCHAR, max_length=100),
    FieldSchema(name="var_array", dtype=DataType.ARRAY, element_type=DataType.VARCHAR, max_capacity=20, max_length=100),
]
schema = CollectionSchema(fields)

utility.drop_collection(collection_name)
collection = Collection(collection_name, schema)

collection.insert({"id": 1, "vector": [random.random() for _ in range(dim)], "var": "abc_1_9", "var_array": ["abc_1_0"]})
collection.insert({"id": 2, "vector": [random.random() for _ in range(dim)], "var": "abc_2_9", "var_array": ["abc_2_0", "abc_2_1", "abc_2_2"]})
collection.insert({"id": 3, "vector": [random.random() for _ in range(dim)], "var": "abc_3_9", "var_array": ["abc_3_5"]})

collection.flush()

collection.create_index("vector", {"index_type": "AUTOINDEX", "metric_type": "IP"})
collection.load()

res = collection.query(expr="var_array[0] like \"abc_2%\"", output_fields=["var_array"])
for r in res:
    print(r)

Got an error:
pymilvus.exceptions.MilvusException: <MilvusException: (code=65535, message=fail to Query on QueryNode 1: worker(1) query failed: Operator::GetOutput failed for [Operator:FilterBits, plan node id: 0] : => unsupported operator type for unary expr: Match at /workspace/source/internal/core/src/exec/expression/UnaryExpr.cpp:319

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

@yhmo yhmo added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 28, 2024
@yanliang567
Copy link
Contributor

/assign @xiaocai2333
/unassign

@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 28, 2024
@sre-ci-robot sre-ci-robot assigned JsDove and unassigned JsDove Nov 29, 2024
@JsDove
Copy link
Contributor

JsDove commented Nov 29, 2024

/assign @JsDove

sre-ci-robot pushed a commit that referenced this issue Dec 5, 2024
…ore (#38085)

Enhance the matching for elements within the UnaryRangeArray
#38068

---------

Signed-off-by: Xianhui.Lin <[email protected]>
@xiaocai2333
Copy link
Contributor

/assign @yhmo please help verify it.
/assign @yanliang567 please add some test cases for this scenario?

@yanliang567
Copy link
Contributor

/assign

@yanliang567
Copy link
Contributor

/assign @NicoYuan1986
please help to check the existing tests and add a few more if needed

sre-ci-robot pushed a commit that referenced this issue Dec 18, 2024
…nderscore (#38302)

Enhance the matching for elements within the UnaryRangeArray
#38068

---------

Signed-off-by: Xianhui.Lin <[email protected]>
@yhmo
Copy link
Contributor Author

yhmo commented Dec 18, 2024

I have verified, no problem.

@yhmo yhmo closed this as completed Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants