Raise exception if filter supplied for query (#338)

This commit is contained in:
Tanay Soni 2020-08-27 10:05:10 +02:00 committed by GitHub
parent 0ad22d5038
commit f0fe16774f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,6 +141,8 @@ class FAISSDocumentStore(SQLDocumentStore):
def query_by_embedding(
self, query_emb: np.array, filters: Optional[dict] = None, top_k: int = 10, index: Optional[str] = None
) -> List[Document]:
if filters:
raise Exception("Query filters are not implemented for the FAISSDocumentStore.")
if not self.faiss_index:
raise Exception("No index exists. Use 'update_embeddings()` to create an index.")
query_emb = query_emb.reshape(1, -1)