GithubHelp home page GithubHelp logo

Comments (7)

bachmanm avatar bachmanm commented on September 26, 2024

Could you post the entire piece of the code where you're creating your GraphDatabaseService? If you're using the properties approach, it needs to look something like:

 GraphDatabaseService database = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(pathToDb)
    .loadPropertiesFromFile(this.getClass().getClassLoader().getResource("neo4j.properties").getPath())
    .newGraphDatabase();

from neo4j-uuid.

amosjyng avatar amosjyng commented on September 26, 2024

Thanks, this is my initialization code:

String neo4jSettingsPath = Database.class.getClassLoader().getResource("neo4j.properties").getPath();
this.neo4jdb = new GraphDatabaseFactory()
        .newEmbeddedDatabaseBuilder(new File("test.db"))
        .loadPropertiesFromFile(neo4jSettingsPath)
        .newGraphDatabase();

RuntimeRegistry.getRuntime(this.neo4jdb).waitUntilStarted();

try (Transaction tx = this.neo4jdb.beginTx())
{
    assert this.neo4jdb.index().existsForNodes("uuidIndex");
}

from neo4j-uuid.

bachmanm avatar bachmanm commented on September 26, 2024

ok, second pair of eyes didn't help, so I had to debug through this only to find out you're asserting the wrong thing :)

So, either change your config to

com.graphaware.module.UIDM.uuidIndex=uuidIndex

or your test to

assert this.neo4jdb.index().existsForNodes("nodeIndex");

from neo4j-uuid.

amosjyng avatar amosjyng commented on September 26, 2024

D'OH! Hahahaha, thanks!

Though... I still can't seem to get the assertion to pass, and no indices seem to be created either. I've created a small program that produces the problem I'm seeing, would you be willing to take a look at that? I'm sure it's something stupid again, just can't figure out what it is. Sorry for the trouble.

from neo4j-uuid.

bachmanm avatar bachmanm commented on September 26, 2024

Two problems with your app:

  1. you need to create a node first that is indexed, in order to see the index
  2. you're asserting a schema index, but this module uses legacy indexes. The reason for that is that schema indexes are tied to labels, but we want to create the index no matter what labels your node has, even if it has none.

from neo4j-uuid.

bachmanm avatar bachmanm commented on September 26, 2024

I issued a pull request to your repo that demonstrates what I just said

from neo4j-uuid.

amosjyng avatar amosjyng commented on September 26, 2024

I see, that works, thank you so much! :)

from neo4j-uuid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.