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

UnexpectedResponse: Unexpected Response: 400 (Bad Request) Raw response content: b'{"status":{"error":"Format error in JSON body: data did not match any variant of untagged enum Condition at line 1 column 19605"},"time":0.0}' #849

Closed
KunalBose07 opened this issue Apr 25, 2024 · 1 comment

Comments

@KunalBose07
Copy link

Code without Filter

hits = client.search(
collection_name=cluster_name,
query_vector=get_embedding("Cotton cloth 23x17x5.5mm"),
limit=3
)

Output
Cosine Similarity score:0.87813747 and Product: cotton osteotomy cloth 20millimeterx5.5millimeter sterile. and Product Type: cotton osteotomy cloth

Cosine Similarity score:0.87775576 and Product: cotton cloth titanium 20millimeterx4.5millimeter sterile. and Product Type: cotton osteotomy cloth

Code with Filter

hits_2 = client.search(
collection_name=cluster_name,
query_vector=get_embedding("Cotton cloth 23x17x5.5mm"),
limit=5,
query_filter=Filter(
must=[FieldCondition(key="Product Type", match=MatchValue(value='cotton osteotomy cloth'))]
),
)

Error :
UnexpectedResponse: Unexpected Response: 400 (Bad Request)
Raw response content:
b'{"status":{"error":"Format error in JSON body: data did not match any variant of untagged enum Condition at line 1 column 19605"},"time":0.0}'

Information:

  1. type(payload.hit["Product Type"]) is
  2. type("cotton osteotomy cloth") is str.
  3. Also i imported the necessary libraries.

Please let me know root cause for such issue ?

@Anush008
Copy link
Member

Could be due to the white-space in the key. Product Type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants