2010/9/24 Andreas Ronge <andreas.ro...@jayway.se> > On Thu, Sep 23, 2010 at 7:50 PM, Mattias Persson > <matt...@neotechnology.com> wrote: > > 2010/9/23 Andreas Ronge <andreas.ro...@jayway.se> > > > >> That's really good news ! > >> Does it also work if it was not indexes as Strings ? ( so that we can > >> sort integers or floats without any padding) > >> I guess that requires that neo4j-lucene adds NumericField instances to > >> the lucene document. > >> > > > > Exactly, I'm just working on a solution for that... I'm not sure it > should > > index all Integer, Long, Float, Double values implicitly as NumericField > > since those aren't searchable with a regular term query. Maybe do > something > > explicit like: > > > > myIndex.add( entity, "age", new ValueContext( 31 ).indexNumeric() ); > > ... > > // Query integer range > > myIndex.query( NumericRangeQuery.newIntRange( "age", 30, 40, true, > false > > ) ); > > // And with sorting (quite verbose though) > > myIndex.query( new QueryContext( NumericRangeQuery.newIntRange( > > "age", 0, 100, true, true ) ).sort( new Sort( new SortField( > "age", > > SortField.INT ) ) ) ); > > > > So that you must know what you're doing... would that be ok or any other > > better idea? > > I think it's great that we have access to the full lucene API in the > QueryContext. > I don't care if it's verbose since I will wrap it in a nice JRuby API :-) > I've already started to document how my lucene sorting and range query > API will look like in Neo4j.rb; > http://github.com/andreasronge/neo4j/wiki/Lucene > (I will specify both the field will be indexed as numerical and of what > type.) >
Great, so I'll try to get this going and make a commit when I get the time (almost working locally). -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user