[Neo] Request a sample code to illustrate finding all nodes where key < value

Mattias Persson mattias at neotechnology.com
Sun Jan 10 20:34:16 CET 2010


I'm almost positive I gave such an example in another thread
recently... anyways:

IndexService index = new LuceneFulltextQueryIndexService( neo );
index.index( myNode1, "someKey", 150 );
index.index( myNode2, "someKey", 100 );
index.index( myNode3, "someKey", 170 );
index.index( myNode4, "someKey", 230 );

// This will return myNode1, myNode2 and myNode3
index.getNodes( "someKey", "[0 TO 170]" );

See http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Range%20Searches
for more information.

2010/1/10 Zerony Zhao <bw.linux at gmail.com>:
> Hi Neo4j Users,
>
> I have a naive question, since I just began learning Neo4j.
>
> I know how to find nodes where property key matchs value,
>
> indexService.getNodes(key, value);
>
> But I do not know the efficient way to find key < value, given the key is an
> int property. In another thread, Tobias wrote several days ago:
>
> If your queries are as simple as "give me all nodes where x>LOWER_LIMIT and
> x<UPPER_LIMIT ordered by x", and you can reduce the x property to a long
> integer value.
>
> But I do not know how to , would you kindly give me a snapshot of code to
> illustrate how to find all nodes where key < value.
>
> Appreciate your help.
>
> Zerony
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [mattias at neotechnology.com]
Neo Technology, www.neotechnology.com


More information about the User mailing list