I did a bit of poking at this last week, and noticed the same thing you did
- we don't expose much of the power of the lucene index through the REST
API.

The question is, how should we go about doing it (and perhaps even "Should
we?")? We really don't want the API to be Lucene-specific (which is why
we're currently only allowing that one query string as input).. I suppose we
could keep a generic API like we have now, but also allow index
implementations to expose "extra" API goodies in some reasonable way..

/jake

On Sun, May 1, 2011 at 4:12 PM, Todd Chaffee <[email protected]> wrote:

> Hi Michael,
>
> I actually appreciated the suggestion because it got me looking closer at
> the lucene query syntax and thinking about it's limitations.  I would like
> to see limits, sorting, and operators like > and <.  If I remember right
> they are available in the lucene java api so a shame they haven't been
> added
> to the query syntax yet.
>
> Thanks,
> Todd
>
>
> > ------------------------------
> >
> > Message: 2
> > Date: Sat, 30 Apr 2011 15:09:50 +0200
> > From: Michael Hunger <[email protected]>
> > Subject: Re: [Neo4j] User Digest, Vol 49, Issue 85
> > To: Neo4j user discussions <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset=us-ascii
> >
> > Todd,
> >
> > Sorry, you're right, I mixed up range queries with limits.
> >
> > Thought that would be also be possible via the query parser syntax.
> >
> > It would be nice if lucene supported query limits via their parsed query
> > syntax.
> >
> > Sorry for the confusion.
> >
> > Michael
> >
> > Am 30.04.2011 um 14:48 schrieb Todd Chaffee:
> >
> > > 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
> >
> >
> >
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Jacob Hansson
Phone: +46 (0) 763503395
Twitter: @jakewins
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to