2
我需要的是如何將節點添加到索引使用Neo4JClientNeo4JClient - 如何添加節點,以指數
在我創建了一個索引和僱員節點下面的C#代碼的一個非常簡單的例子。
問:
在下面的代碼,如何能已創建的節點添加到索引?解決方案應該允許在EmployeeID或Name上進行搜索。
class Program { static void Main(string[] args) { //Connect to Neo4J var graphClient = new GraphClient(new Uri(@"http://localhost:7474/db/data")); graphClient.Connect(); //Create Index graphClient.CreateIndex("employee", new IndexConfiguration() { Provider = IndexProvider.lucene, Type = IndexType.exact }, IndexFor.Node); //Create an Employee node var employee = new Employee() { EmployeeID = "12345", Name = "Mike"}; NodeReference employeeRef = graphClient.Create(employee); //Add the node that was just created to the Employee index. }
private class Employee { [JsonProperty("EmployeeID")] public string EmployeeID { get; set; } [JsonProperty("Name")] publi