You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: filtering by metadata works correctly in python:
def filter(metadata):
return set(tags).intersection(metadata["tags"]) is not None and (category is None or category in metadata["categories"])
vector_store = FAISS.load_local(vector_store_file, embeddings, allow_dangerous_deserialization=True)
results = vector_store.similarity_search_with_score(query_text, k=3, filter=filter)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
vectorStore.similaritySearch
in javascript is not calling the filter function. how to solve it?Note: The docs mentions "Filtering by metadata is currently not supported.", however, the source code seems to have it implemented.
https://js.langchain.com/v0.2/docs/integrations/vectorstores/faiss/
langchainjs/langchain-core/src/vectorstores.ts
Line 184 in 3cc45fe
Note: filtering by metadata works correctly in python:
Beta Was this translation helpful? Give feedback.
All reactions