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

Zerony Zhao bw.linux at gmail.com
Tue Jan 12 01:52:59 CET 2010


Thanks for your reply.

Since I am trying to search a range of integer, index.getNodes( "someKey",
"[0 TO 1]" ) will returns node with "somekey" value such as 1, 11, 111
supposing having 1, 11, 111, but I only want returning 1 exactly. I know one
of solution is using padding scheme to solve the problem. Is there any other
ways to solve the problem?

On Sun, Jan 10, 2010 at 1: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
>


More information about the User mailing list