Google Groups

Re: [Blueprints] Neo4j query capabilities with Blueprints Index


Marko A. Rodriguez Feb 8, 2011 6:13 PM
Posted in group: Gremlin-users
Hi,

Its simply a String for Neo4j.
graph.getIndex(Index.VERTICES, Vertex.class).get("name", Neo4jTokens.QUERY_HEADER + "*rko")
graph.getIndex(Index.EDGES, Edge.class).get("label", Neo4jTokens.QUERY_HEADER + "k?ows")
graph.getIndex(Index.EDGES, Edge.class).get("weight", Neo4jTokens.QUERY_HEADER + "[0.5 TO 1.0]")

In OrientGraph, does this already exist or is there something special that needs to be done? Meaning, if I do:

OrientIndex.get("name", "*STAR") will that work as is right now? Or do we need to do some sort of OrientTokens.QUERY_HEADER model too?

Thanks,
Marko.


On Feb 8, 2011, at 6:51 PM, Luca Garulli wrote:

Hi Marko,
yes OrientDB has similar feature but it's not Lucene under the hood. Could you leave it just as a String?

Lvc@

On 9 February 2011 02:30, Marko Rodriguez <okram...@gmail.com> wrote:
Hi,

A fellow emailed me privately asking me if Blueprints supported Lucene querying over Neo4j.

I said: "No. Neo4jIndex uses index.get(), not index.query()." Then I said: "I shall rectify this."

So I did. Its a bit of a hack, but I think its nice.

Check it:
       http://paste.pocoo.org/show/334747/
(NOTE: I'm using full Java notation so its apparent what to do if you are in Blueprints -- not Gremlin).

In short, if you append Neo4jTokens.QUERY_HEADER to your value in a Neo4jIndex.get() call, it will know that you want to do a Lucene-style query. Right now, Neo4jTokens.QUERY_HEADER == "%query%" (WARNING: may change, use Neo4jTokens.QUERY_HEADER to be safe).

Its a hack.... any other ideas are more than welcome. ???

I've committed the code to GitHub and updated Blueprints 0.5-SNAPSHOT in the TinkerPop Maven2 repository with the latest deployment.

LUCA: Does OrientDB support such text searching? Should we add this too OrientGraph?

Thoughts?,
Marko.

http://markorodriguez.com