Sorry, but the Lucene and Solr query parsers do not have support for the relational operators (although the LucidWorks Search query parser does, but that's for Solr). You simply need to use range queries:

x < v   -> x:[* TO v}
x <= v   -> x:[* TO v]
x > v -> x:{v TO *]
x >= v -> x:[v TO *]

Note the use of curly braces for exclusive end points.

-- Jack Krupansky

-----Original Message----- From: Umashanker, Srividhya
Sent: Tuesday, October 29, 2013 3:57 AM
To: java-user@lucene.apache.org
Subject: DateQuery with comparison operators

HI -

I are using Lucene 4.5 and want to support date comparisons with < > <= >= !=. Right now, we parse the string and create RangeQuery. Is there an inbuilt way to do date based comparisons ie., "dob <= 2013-10-23T14:47:54.776Z"

-Vidhya

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to