Skip to content

S3VectorClient query filter parameter is complex to use #6279

@MatejNedic

Description

@MatejNedic

Describe the feature

When using S3 Vector store current api for filtering requires Document object which makes filtering rather complex.

Writting a filter for example in Python is much easier.

query = s3vectors.query_vectors( vectorBucketName="channy-vector-bucket",
  indexName="channy-vector-index",
  queryVector={"float32":embedding},
  topK=3, 
  filter={"genre":"scifi"},
  returnDistance=True,
  returnMetadata=True
  )

It would be great if Java sdk would support filter(String filterJson) or filter(Map<String, Object>) this would make generic dynamic filtering much simpler.

Complex filter for example with aws cli.

filter '{"$and": [{"category": "tech"}, {"version": {"$gte": "1.0"}}]}'

Writting it with Java is long with a lot of Document.asString() and Document.asMap() or Document mapBuilder

Use Case

S3 Vector Store preview querying and filtering vectors.

Proposed Solution

Allow filter to be plain String which user can serialize on their own or support Map<String,Object>

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

Latest

JDK version used

21

Operating System and version

MacOs

Metadata

Metadata

Assignees

Labels

feature-requestA feature should be added or improved.p3This is a minor priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions