Consulting and Contracting; Proven Results!
i. Neo4J, Java, LiveCycle ES, Flex, AIR, CQ5 & Mobile
From: Mahdi Negahi <negahi.ma...@gmail.com<mailto:negahi.ma...@gmail.com>>
Reply-To: "email@example.com<mailto:firstname.lastname@example.org>" <email@example.com<mailto:firstname.lastname@example.org>>
Date: Thursday, 3 May, 2012 8:58 PM
To: "email@example.com<mailto:firstname.lastname@example.org>" <email@example.com<mailto:firstname.lastname@example.org>>
Subject: Re: [Neo4j] Getting existing Indexs By Java
you know I want convert a Neo4j graph to other databases .
DN: So that is just silly. Why would anyone want to ever do that? ;-)
I convert all the component of a Neo4j database to the target. But I missed index item in the target environment. I want to know, Is there any chance to convert indexed item to the XML or something else ?
DN: Okay , seriously, there are 6 major classes in Java that work with indexes.
I think you why you want, the INdexManager has a lot of methods worth exploring. Whoever designed this class clearly thought of your use case. I will provide a caveat however. I may have misunderstood your request. If not, IndexManager has a method nodeIndexNames<cid:12E4D8AC-F566-4939-AD45-F00C3637849E>()
Which returns an array 9String) of all the nodes that are indexes. One returned, you can serialize them into any data format with simple parlous tricks.
Perhaps I did not understand your request?
for example, imagine we have a graph with two nodes and a relationship.
node 1 :
Property --> Name: Mahdi
Index (PKEY)--> PrimeryKey: 50
Property --> Name: Peter
Index (PKEY)--> PrimeryKey: 1
property ---> Since: 2012
so we past this graph to the application and the result something like this
<Node ID=1> <Index Name="PKEY" Key="PrimeryKey" Value="50 /> </Node>
<Node ID=2> <Index Name="PKEY" Key="PrimeryKey" Value="1 /> </Node>
it is much noticeable that we do not have any assumption about index's name , index key .... we just past a graph to the program or function and it returns the : index name , index key and index value with a specific format
On Monday, April 30, 2012 1:22:13 PM UTC+8, Peter Neubauer wrote:
It's hard to read your question. Do you have any code that shows your problem?
On Apr 30, 2012 6:22 AM, "Mahdi Negahi" <negahi.ma...@gmail.com<mailto:negahi.ma...@gmail.com>> wrote:
even we can not convert items that they indexed to the XML or something like that.
On Sunday, April 29, 2012 8:38:59 PM UTC+8, Mattias Persson wrote:
The values are stored in the lucene documents, but API-wise you cannot reach them I'm afraid.
2012/4/29 Mahdi Negahi <negahi.ma...@gmail.com<mailto:negahi.ma...@gmail.com>>
thanks for ur reply
The application must be worked with all graph, so I don't know the information is stored as node's property.
On Saturday, April 28, 2012 2:31:42 AM UTC+8, Michael Hunger wrote:
Did you store the information also as property on the node?
Otherwise you'd have to use some low level lucene operations to extract it, you can do it manually with the lucene tool called luke,
It can export this data into xml, see: http://www.getopt.org/luke/
"Export to XML - exports index data and metadata to XML file. This is available both from the GUI and from the command-line."
I don't have the code at hand to read and use the lucene database format programmatically.
Am 27.04.2012 um 19:27 schrieb Mahdi Negahi:
I want to store all nodes that they indexed by corresponding index to other databases. imagine our database has 1 node that it indexed by a index which is called "PrimaryKey" the key of the index is "PKEY" and the value is "125". we just added this Index by following code:
IndexManager index = graphDb.index();
Index<Node> PrimaryKey= index.forNodes( "PrimaryKey");
PrimaryKey.add( node1, "PKEY", "125");
so when we pars the databases when we analyse this node , the application must be fetch all the node index (PrimaryKey) the key of the index (PKEY) and the value (125).
I want to save these information in other databases.
Thanks for ur answer
On Friday, April 27, 2012 9:19:47 PM UTC+8, Axel wrote:
for(String s :_graphDb.index().nodeIndexNames())
Mattias Persson, [matt...
Hacker, Neo Technology