Hi Michael,

Unless I'm misunderstanding something, what you suggested won't help.  I
have only 1 key: "name".  If I search on it with a query like
?query=name:*a* it is going to return all nodes with the letter 'a' in the
name.   The result set could be over 100,000 nodes.  I want it to return
just the first 4 nodes.  Does that make sense?  If there is a simpler way of
achieving this aside from a custom plugin I am all ears.

When did the full lucene query API syntax become available with the REST
API?  Docs have only changed in the last few days but I'm guessing (hoping)
the docs were a bit behind and now reflect version 1.3 of the server?

Thanks,
Todd



> Todd,
>
> what about the full lucene query API syntax available with the REST API
> changes ?
>
>
> http://components.neo4j.org/neo4j-server/snapshot/rest.html#Index_search_-_Using_a_query_language
>
> e.g.
>
> GET /index/node/my_nodes?query=the_key:the_* AND the_other_key:[1 TO 100]
>
> with curl:
> curl -H Accept:application/json
> http://localhost:7474/db/data/index/node/my_nodes?query=the_key:the_*%20AND%20the_other_key:[1%20TO%20100]
>
> Shouldn't that help too?
>
> Cheers
>
> Michael
>
>
> Am 30.04.2011 um 01:46 schrieb Todd Chaffee:
>
> > This doesn't solve the lack of paging in the REST API, but it is a small
> > example of how I was able to limit the returned results for a large
> query.
> >
> > Using the REST API query, looking for all nodes with the letter 'a'
> > somewhere in the name key, would look something like this:
> >
> > curl -H Accept:application/json
> > http://localhost:7474/db/data/index/node/names/name?query=*a*
> >
> >
> > For my installation, that tries to return a few hundred thousand
> > nodes.  Not a good idea.
> >
> >
> > The new version looks like this, using the server plugin feature
> > (http://docs.neo4j.org/chunked/stable/server-plugins.html):
> >
> >
> > curl -X POST -H Accept:appplication/json -H
> > Content-Type:application/json
> > http://localhost:7474/db/data/ext/NodeIndex/graphdb/limit_by_count -d
> > '{"index":"names", "key":"name", "query":"*a*", "count":4}'
> >
> >
> > With the interesting part being the count of 4 at the end.  Only 4
> > nodes are returned and it happens FAST because on the server side the
> > iteration stops at 4, only 4 nodes are created, and only 4 sent over
> > the wire.
> >
> >
> > More documentation and source code showing how I did this over at github.
> > Hope this helps some of you out there while we wait for the REST api to
> > support paging.
> >
> > https://github.com/tchaffee/Neo4J-REST-PHP-API-client
> >
> > Todd
> >
> > --
> >
> > MIKAMAI | Making Media Social
> > http://mikamai.com
> > +447868260229
> > _______________________________________________
> > Neo4j mailing list
> > [email protected]
> > https://lists.neo4j.org/mailman/listinfo/user
>
>
>
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to