"UNWIND nodes AS n "
            "RETURN n.node AS node, (n.score / max) AS score "  # We use 0 as min
            "} "
            "WITH node, max(score) AS score ORDER BY score DESC LIMIT $k "  # dedup
        ),
    }
    return type_to_query_map[search_type]
[docs]def check_if_not_null(props: List[str], values: List[Any]) -> None:
    for prop, value in zip(props, values):
        if not value:
            raise ValueError(f"Parameter `{prop}` must not be None or empty string")
[docs]def sort_by_index_name(
    lst: List[Dict[str, Any]], index_name: str
) -> List[Dict[str, Any]]:
    """Sort first element to match the index_name if exists"""
    return sorted(lst, key=lambda x: x.get("index_name") != index_name)
[docs]class Neo4jVector(VectorStore):
    """`Neo4j` vector index.
    To use, you should have the ``neo4j`` python package installed.
    Args:
        url: Neo4j connection url
        username: Neo4j username.
        password: Neo4j password
        database: Optionally provide Neo4j database
                  Defaults to "neo4j"
        embedding: Any embedding function implementing
            `langchain.embeddings.base.Embeddings` interface.
        distance_strategy: The distance strategy to use. (default: COSINE)
        pre_delete_collection: If True, will delete existing data if it exists.
            (default: False). Useful for testing.
    Example:
        .. code-block:: python
            from langchain.vectorstores.neo4j_vector import Neo4jVector