Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CALL db.indexes() docs #72

Closed
gkorland opened this issue Sep 7, 2024 · 0 comments · Fixed by #76
Closed

CALL db.indexes() docs #72

gkorland opened this issue Sep 7, 2024 · 0 comments · Fixed by #76
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@gkorland
Copy link
Contributor

gkorland commented Sep 7, 2024

I got it when I tried to YIELD type from a """CALL db.indexes() """ query I made.

This was the error: redis.exceptions.ResponseError: Procedure db.indexes does not yield output type

In the docs, it says it does YIELD type or I'm I misinterpreting something
The code I used is attached.

from falkordb import FalkorDB


db = FalkorDB()

graph = db.select_graph("Test")


result = graph.query("""
MERGE  (a:Person {first_name:"Frank", last_name:"Ocean"})
MERGE  (b:Person {first_name:"Frank", last_name:"Sinatra"})
MERGE  (c:Person {first_name:"Frank", last_name:"Cavier"})
MERGE  (d:Song {title:"In my room"})
MERGE  (e:Song {title:"Falling in love"})
MERGE  (f:Song {title:"Telenovela"})
MERGE  (a)-[:Sang]->(d)
MERGE  (b)-[:Sang]->(e)
MERGE  (c)-[:Sang]->(f)
RETURN a, b, c, d, e, f
""")

for node in result.result_set[0]:
    print(node)


#create a fts index on a node
try:
    result2 = graph.query("""
    CALL db.idx.fulltext.createNodeIndex('Person', 'first_name')
    """)

    print(result2.result_set)
except Exception as e:
    if "already indexed" in str(e):
        print("Node attribute is already indexed")

try:
    result4 = graph.query("""
    CALL db.idx.fulltext.createNodeIndex('Song', 'title')
    """)
    print(result4.result_set)
except Exception as e:
    if "already indexed" in str(e):
        print("Node attribute is already indexed")



#print all indexes
result3 = graph.query("""
CALL db.indexes() YIELD type
""")

print("\nResult 3: ", result3.result_set)
@gkorland gkorland added the documentation Improvements or additions to documentation label Sep 7, 2024
@AviAvni AviAvni linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants