我已經經歷了Neo4j的和Neo4j的C#客戶端指標工作..在Neo4j的
的neo4jclient wiki幫助我與節點CRUD操作。但是維基到此爲止突然.. 戳我的周圍test methods in source code並設法瞭解關係並在線搜索以瞭解索引的工作原理。
到目前爲止,這裏就是我的,大致爲:
//create indexing on user and car
client.CreateIndex("User", new IndexConfiguration() { Provider = IndexProvider.lucene, Type = IndexType.fulltext }, IndexFor.Node);
client.CreateIndex("Car", new IndexConfiguration() { Provider = IndexProvider.lucene, Type = IndexType.fulltext }, IndexFor.Node);
//create user
client.Create(new User() { Name = "Dovakiin", Job = "Dragon Slayer" });
client.Create(new User() { Name = "Ulfric stormcloak", Job = "Imperial Slayer" });
//create Car
client.Create(new Car() { Name = "Paarthurnax", Modal = 212 });
//User owns car relationship
client.CreateRelationship(userRef, new Owns_CarRelationship(CarRef));
這是我現在停留。當我試圖尋找由名稱的用戶,我的密碼查詢返回結果爲零:
start u=node:User(Name="Dovakiin") return u;
,我不明白爲什麼它返回零個節點時,明確
start n=node(*) return n;
節目所有節點。
我是否在編制索引時缺少其他內容?或者這與索引無關?我不需要將每個節點添加到索引?
我試圖做的是選擇具有給定屬性的節點:Name = "Dovakiin"
在這種情況下..我該如何選擇這個?
謝謝!哇,這正是我想要的!從我上面評論ulkas的答案的鏈接SO問題,我設法添加節點索引手動,但更喜歡自動索引..是的,整個文檔是混淆,但我慢慢到達那裏! ('''Name:Parthurnax - immune-magic「'')這個名字沒有特別的理由,只是鍵入任何..然而,shell腳本返回節點OK,neo4jclient發生500錯誤。哦,我只是刪除unicode連字符並嘗試。再次感謝! – LocustHorde
不客氣!但我仍然覺得@ulkas比我更好地回答了這個問題。他甚至提到了自動索引,但是我只是擴展了,因爲我第一次在neo4j.org上閱讀文檔時記得有點困惑。無論如何,我很高興你能開始工作,因爲我記得那讓我瘋狂! –
@LocustHorde關於500錯誤,你可以在http://hg.readify.net/neo4jclient上提出一個問題,以便我們修復它嗎? –