Skip to content

Weaviate: enable BM25 queries with filters #3553

@masci

Description

@masci

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When BM25 support was firstly introduced in 1.14, Weaviate didn't support passing filters along with the query and Haystack raises an exception when you call query() with both a query text and some filters.

Describe the solution you'd like
This is now supported in 1.16 and we should amend this part of the code

# Once Weaviate starts supporting filters with BM25:
# filter_dict = LogicalFilterClause.parse(filters).convert_to_weaviate()
# gql_query = weaviate.gql.get.GetBuilder(class_name=index,
# properties=properties,
# connection=self.weaviate_client) \
# .with_near_vector({'vector': [0, 0]}) \
# .with_where(filter_dict) \
# .with_limit(top_k) \
# .build()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions