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

Tobias Ivarsson tobias.ivarsson at neotechnology.com
Sun Jan 10 21:48:58 CET 2010


You did Mattias, in the same thread as Zerony is referring to.

When I wrote the remark Zerony quoted I was thinking about the Timeline
index, that is tailored specifically for range queries and large datasets.

There is a very understandable usage example under "Timline" in the
documentation for the index-util component:
   http://components.neo4j.org/index-util/
You might also find the API documentation for Timeline interesting:

http://components.neo4j.org/index-util/apidocs/org/neo4j/util/timeline/TimelineIndex.html

Cheers,
Tobias

On Sun, Jan 10, 2010 at 8:34 PM, Mattias Persson
<mattias at neotechnology.com>wrote:

> 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
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Tobias Ivarsson <tobias.ivarsson at neotechnology.com>
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857


More information about the User mailing list