Skip to content

Instantly share code, notes, and snippets.

@crajah
Created November 7, 2020 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crajah/b39abb6a580ee39850aef834816bce63 to your computer and use it in GitHub Desktop.
Save crajah/b39abb6a580ee39850aef834816bce63 to your computer and use it in GitHub Desktop.
In this example, airports, flights and airportSearch are constructed inside the Graph object. However, I want to be able to create the Graph first then create the Collection[D] on the fly.
object database extends Graph(databaseName = "graphTest") {
val airports: DocumentCollection[Airport] = vertex[Airport]
val flights: DocumentCollection[Flight] = edge[Flight]
val airportSearch: View[Airport] = view(
name = "airportSearch",
collection = airports,
analyzers = List(Analyzer.Identity),
includeAllFields = true,
fields = Airport.name -> List(Analyzer.TextEnglish)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment