Python Language Neo4j and Cypher using Py2Neo Query 1 : Autocomplete on News Titles

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


def get_autocomplete(text):
    query = """
    start n = node(*) where =~ '(?i)%s.*' return,labels(n) limit 10;
    query = query % (text)
    obj = []
    for res in graph.cypher.execute(query):
        # print res[0],res[1]
    return res

This is a sample cypher query to get all nodes with the property name that starts with the argument text.

Got any Python Language Question?