mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-14 08:56:27 +00:00
community[patch]: Ignore null and invalid embedding values for neo4j metadata filtering (#20558)
This commit is contained in:
parent
718c9cbe3a
commit
27370b679e
@ -956,8 +956,17 @@ class Neo4jVector(VectorStore):
|
|||||||
"Metadata filtering can't be use in combination with "
|
"Metadata filtering can't be use in combination with "
|
||||||
"a hybrid search approach"
|
"a hybrid search approach"
|
||||||
)
|
)
|
||||||
parallel_query = "CYPHER runtime = parallel " if self._is_enterprise else ""
|
parallel_query = (
|
||||||
base_index_query = parallel_query + f"MATCH (n:`{self.node_label}`) WHERE "
|
"CYPHER runtime = parallel parallelRuntimeSupport=all "
|
||||||
|
if self._is_enterprise
|
||||||
|
else ""
|
||||||
|
)
|
||||||
|
base_index_query = parallel_query + (
|
||||||
|
f"MATCH (n:`{self.node_label}`) WHERE "
|
||||||
|
f"n.`{self.embedding_node_property}` IS NOT NULL AND "
|
||||||
|
f"size(n.`{self.embedding_node_property}`) = "
|
||||||
|
f"toInteger({self.embedding_dimension}) AND "
|
||||||
|
)
|
||||||
base_cosine_query = (
|
base_cosine_query = (
|
||||||
" WITH n as node, vector.similarity.cosine("
|
" WITH n as node, vector.similarity.cosine("
|
||||||
f"n.`{self.embedding_node_property}`, "
|
f"n.`{self.embedding_node_property}`, "
|
||||||
|
Loading…
Reference in New Issue
Block a user