You could perhaps use the LuceneFulltextQueryIndexService (which is a LuceneFulltextIndexService, but which interprets the "value" argument in getNodes() as lucene query syntax<http://lucene.apache.org/java/2_9_1/queryparsersyntax.html>). Index your <URI>|<time> as a one concatenated value and query it with range queries<http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Range%20Searches>, f.ex: [http://my-uri|0000000000000 TO http://my-uri|1270797634350] (since all values are strings in lucene), and grabbing the last one. If the results of the range query could be reversed you could grab the first one instead, which would be much better.
This solution doesn't strike me as being particularly good, but might work (I haven't tried it). 2010/4/8 Lyudmila L. Balakireva <lu...@lanl.gov> > Hi, > > I have question how to better deal with time range index. I am using > Sail layer to build a triple store with context as time value. I need > binary search the nearest context value for the given uri and requested > time. > For example for the mysql it will be table [ uri,time ] where rows: > u ,t1 > u, t2 > u1,t1 > u2,t2 > etc. > having the given uri u and time t t1 < t <t2 I can fast find the > nearest t1 for uri u by query: select max (time) where time<t and uri > =u; > > Is any internal trick I can use for neo4j to build such index or > optimize the operation? > The timeline index is somewhat different since I need first to break > recordset by uri and then find time. It will be many millions of > timelines attached to the one node and I still need to iterate thru the > nodes. What else can be done here then Mysql? > Thank you for help, > Luda > _______________________________________________ > Neo mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com _______________________________________________ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user