AFAIK this behavior is specific to lucene as lucene indexes everything as Strings following their natural order. http://wiki.apache.org/lucene-java/SearchNumericalFields
2010/1/11 Zerony Zhao <[email protected]>: > Hi Neo4j users, > > I am confused with LuceneFulltextQueryIndexService. > > For integer, > > IndexService index = new LuceneFulltextQueryIndexServic > e( neo ); > index.index( myNode1, "someKey", 1 ); > index.index( myNode2, "someKey", 2 ); > index.index( myNode3, "someKey", 12 ); > index.index( myNode4, "someKey", 21 ); > > // This will return myNode1, myNode2 and myNode3, not myNode4, why? > index.getNodes( "someKey", "[1 TO 2]" ); > > If I really want 1 <= x <= 2, I need use the padding pattern. Is there any > other ways to do this work? > > For string, > myNode1 "somekey" --> "a" > myNode2 "somekey" --> "b" > myNode3 "somekey" --> "aa" > > IndexService index = new LuceneFulltextQueryIndexService( neo ); > index.index( myNode1, "someKey", "a" ); > index.index( myNode2, "someKey", "ba" ); > index.index( myNode3, "someKey", "ad" ); > > // This will return myNode1 > index.getNodes( "someKey", "a" ); > > // This will return myNode1, myNode3 > index.getNodes( "someKey", "a*" ); > > //Wrong (Lucene does not support "*a*" > index.getNodes( "someKey", "*a*" ); > > How can I search substring "*a*"? > > And what the mechanism difference of Lucene indexing between integer and > string, if it can be explained here in short sentences? > > Appreciate your help, > > Zerony > _______________________________________________ > Neo mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > -- Raul Raja _______________________________________________ Neo mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

