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

Neo4j Error - There is no such fulltext schema index: entity #3

Open
sherwin684 opened this issue Aug 12, 2024 · 3 comments
Open

Neo4j Error - There is no such fulltext schema index: entity #3

sherwin684 opened this issue Aug 12, 2024 · 3 comments

Comments

@sherwin684
Copy link

I am getting an error with the graph_retriver function where the fulltext search is being done. The method

db.index.fulltext.queryNodes("entity", $query, {limit:2})

returns an error saying that :

There is no such fulltext schema index: entity.

The full error reads

ClientError: {code: Neo.ClientError.Procedure.ProcedureCallFailed} {message: Failed to invoke procedure db.index.fulltext.queryNodes: Caused by: java.lang.IllegalArgumentException: There is no such fulltext schema index: entity}.

@misteral
Copy link

misteral commented Aug 15, 2024

@sherwin684

add this code before querying:

from neo4j import  Driver

def initialize_fulltext_index(driver: Driver):
    with driver.session() as session:
        # Check if the index exists
        session.run("CREATE FULLTEXT INDEX entity IF NOT EXISTS FOR (n:Document) ON EACH [n.text]")
        # logger.info("Fulltext index 'entity' created or already exists")

# Initialize Neo4j driver
neo4j_driver = GraphDatabase.driver("neo4j://localhost:7687", auth=("neo4j", "your_password"))

# Initialize fulltext index
initialize_fulltext_index(neo4j_driver)

@sherwin684
Copy link
Author

@misteral I tried to call your code before querying, but it does not help either. I still get the same error as before.

@Mofek
Copy link

Mofek commented Aug 27, 2024

For me, it's solving the problem but the output is wired:
41e2d6cbaac3f75505bb42104013424b - MENTIONS -> Nonna Lucia
c7c1a9c073ded36181b0e59f17e4ff40 - MENTIONS -> Caruso Family
c7c1a9c073ded36181b0e59f17e4ff40 - MENTIONS -> Antonio
c7c1a9c073ded36181b0e59f17e4ff40 - MENTIONS -> Amico
c7c1a9c073ded36181b0e59f17e4ff40 - MENTIONS -> Lucia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants