I'm using Lucene to index nodes in a Neo4j database and I'm using Lucene query strings to perform queries. Everything behaves as expected when I perform range queries that are either exclusive or inclusive on both ends:
Index.query("value:[1 TO 10]"); // Inclusive range query
Index.query("value:{1 TO 10}"); // Exclusive range query
However, it doesn't seem to work if I specify one end of the range query to be exclusive and the other to be inclusive, for example:
Index.query("value:[1 TO 10}");
I understand that it is possible to perform this query using the QueryContext.numericRange()
method, for example:
Index.query(QueryContext.numericRange("value", 1, 10, true, false));
Why is it not possible to do the same using Lucene query syntax? Am I misunderstanding the syntax or doing something incorrectly code-wise?
References:
http://docs.neo4j.org/chunked/stable/indexing-lucene-extras.html
http://lucene.apache.org/java/3_5_0/queryparsersyntax.html