why is my MetatadataFilter not working as I'd expect?
filters = MetadataFilters(filters=[
ExactMatchFilter(
key="is_published",
value=1
),
])
index = get_redis_index()
retriever = index.as_retriever(filters=filters)
response = retriever.retrieve('how can I deal with my credit card?')
if not response:
print('No documents found')
for doc in response:
print(doc.metadata)
output:
(groove) (base) β blobby-server git:(master) β python -m src.redis_index
17:54:26 redisvl.index.index INFO Index already exists, not overwriting.
No documents found
versus:
filters = MetadataFilters(filters=[
ExactMatchFilter(
key="is_published",
value=0
),
])
output:
groove) (base) β blobby-server git:(master) β python -m src.redis_index
17:55:06 redisvl.index.index INFO Index already exists, not overwriting.
{'content_type': 'text', 'content_id': 'rboPV4SXTMdVcXoZ', 'page_type': 'article', 'slug': 'what-can-i-do-with-my-401-k-after-i-leave-my-job', 'title': 'What can I do with my 401k after I leave my job?', 'keywords': 'what to do 401k leaving job', 'description': 'If you recently switched jobs or retired, you might be wondering what to do with your old 401(k) plan. You have four options with a 401(k) when leaving your job or retiring.', 'subtitle': '', 'author': 'Noa Rodriguez-Hoffman', 'is_published': 1}
This seems backwards to me...