I use Lucene to index nodes in a Neo4j database, and I use Lucene query strings to execute queries. Everything behaves as expected when I execute range queries that are either exclusive or included at both ends:
Index.query("value:[1 TO 10]"); // Inclusive range query Index.query("value:{1 TO 10}"); // Exclusive range query
However, this does not seem to work if I indicate that one end of the range request is exceptional and the other is included, for example:
Index.query("value:[1 TO 10}");
I understand that this query can be executed using the QueryContext.numericRange() method, for example:
Index.query(QueryContext.numericRange("value", 1, 10, true, false));
Why can't this be done using Lucene query syntax? I donβt understand the syntax or am I doing the wrong code?
Literature:
http://docs.neo4j.org/chunked/stable/indexing-lucene-extras.html
http://lucene.apache.org/java/3_5_0/queryparsersyntax.html
source share