how to index node properties between embedded java and ruby rails using HA cluster

4 views
Skip to first unread message

Joao Martins

unread,
May 17, 2012, 6:25:02 AM5/17/12
to Neo4j
Hi,

Wondering if it is possible in a HA cluster to index node properties
between a java embedded instance and a rails instance.

Example:

Insert node and a index in java:

Node node = graphDB.createNode();
node.setProperty("_classname", "ClassName");
node.setProperty("foo", "bar");
nodeIndex.add(node, "foo", "bar");

and now, i need to find it in rails, declaring a Lucene index like
this:

class ClassName < Neo4j::Rails::Model
property :foo, :type => String
index :foo
end

Now i need to find a instance of class ClassName with (indexed)
property "foo" as "bar":
ht = Host.find('foo: bar')
..but this isn't working, however i can find all instances of class
ClassName with
hosts = Host.all (without indexing)

How can i index properties between java and ruby? Any tip?

Thanks
João

Michael Hunger

unread,
May 17, 2012, 6:45:33 AM5/17/12
to ne...@googlegroups.com
Should be no problem just make sure both use the same index and keynames and value types

Sent from mobile device

Joao Martins

unread,
May 17, 2012, 8:18:18 AM5/17/12
to Neo4j
Hi michael, thanks for answering

I think the problem is the indexname as the following:

graphDB.index().forNodes("nodes");

how can i know the indexName parameter of "forNodes" used by rails
active model? or how can i use my indexName "nodes" at rails?

Thanks,
Joao

On 17 Maio, 11:45, Michael Hunger <michael.hun...@neopersistence.com>
wrote:
> Should be no problem just make sure both use the same index and keynames and value types
>
> Sent from mobile device
>

Michael Hunger

unread,
May 17, 2012, 8:23:56 AM5/17/12
to ne...@googlegroups.com, Andreas Ronge
That's rather a question for the neo4jrb google group or Andreas (cc'ed).

Cheers

Michael
Reply all
Reply to author
Forward
0 new messages