Re: Automatically configure graph indexes on JanusGraph creation or startup - Gremlin.Net
the management API is Java-only. But yes, you can configure JanusGraph Server to execute a Groovy script at startup and that Groovy script can then use the management API to configure indices. The default config file for JanusGraph Server already executes a Groovy script `scripts/empty-sample.groovy`: https://github.com/JanusGraph/janusgraph/blob/55a8423b7279ca13d8c258c3f6710897079128dd/janusgraph-dist/src/assembly/static/conf/gremlin-server/gremlin-server.yaml#L29
If you want to use the management API from your .NET application, then you can also send a Groovy script with the Gremlin.Net driver to the server. Sending scripts is explained in the TinkerPop reference docs: https://tinkerpop.apache.org/docs/current/reference/#gremlin-dotnet-scripts
Future versions of JanusGraph will make this more convenient for non-Java applications as we want to add a GRPC based management API.
Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von tormodhau@...
Gesendet: Donnerstag, 22. Dezember 2022 10:44
Betreff: [janusgraph-users] Automatically configure graph indexes on JanusGraph creation or startup - Gremlin.Net
I am currently using JanusGraph together with Gremlin.Net, and need to set up a Composite Indexes for my database. From what I understand this is typically done through the Management API provided by JanusGraphFactory. Since the my codebase is .Net, using the Embedded JVM version of JanusGraphFactory is not possible. Also, I would not want to create indexes manually through the Gremlin Console as the application needs to be automatically provisioned and configured in a cloud environment.
What is the best way to configure indexes for JanusGraph? Are there any configuration properties I have overlooked, or would it perhaps be possible to run a Groovy script with the necessary management commands on server startup?