lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r369559 - in /lucene/java/trunk/src/java/org/apache/lucene/queryParser: QueryParser.java QueryParser.jj
Date Mon, 16 Jan 2006 20:09:53 GMT
Author: dnaber
Date: Mon Jan 16 12:09:48 2006
New Revision: 369559

URL: http://svn.apache.org/viewcvs?rev=369559&view=rev
Log:
document the slightly confusing situation of parsing dates in range queries

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java?rev=369559&r1=369558&r2=369559&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java Mon Jan 16 12:09:48
2006
@@ -44,6 +44,15 @@
  * href="http://lucene.apache.org/java/docs/queryparsersyntax.html">query syntax
  * documentation</a>.
  * </p>
+ * 
+ * <p>In {@link RangeQuery}s, QueryParser tries to detect date values, e.g. <tt>date:[6/1/2005
TO 6/4/2005]</tt>
+ * produces a range query that searches for "date" fields between 2005-06-01 and 2005-06-04.
Note
+ * that the format of the accpeted input depends on {@link #setLocale(Locale) the locale}.
This
+ * feature also assumes that your index uses the {@link DateField} class to store dates.
+ * If you use a different format (e.g. {@link DateTools}) and you still want QueryParser
+ * to turn local dates in range queries into valid queries you need to create your own
+ * query parser that inherits QueryParser and overwrites
+ * {@link #getRangeQuery(String, String, String, boolean)}.</p>
  *
  * <p>Note that QueryParser is <em>not</em> thread-safe.</p>
  *

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj?rev=369559&r1=369558&r2=369559&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.jj Mon Jan 16 12:09:48
2006
@@ -68,6 +68,15 @@
  * documentation</a>.
  * </p>
  *
+ * <p>In {@link RangeQuery}s, QueryParser tries to detect date values, e.g. <tt>date:[6/1/2005
TO 6/4/2005]</tt>
+ * produces a range query that searches for "date" fields between 2005-06-01 and 2005-06-04.
Note
+ * that the format of the accpeted input depends on {@link #setLocale(Locale) the locale}.
This
+ * feature also assumes that your index uses the {@link DateField} class to store dates.
+ * If you use a different format (e.g. {@link DateTools}) and you still want QueryParser
+ * to turn local dates in range queries into valid queries you need to create your own
+ * query parser that inherits QueryParser and overwrites
+ * {@link #getRangeQuery(String, String, String, boolean)}.</p>
+ *
  * <p>Note that QueryParser is <em>not</em> thread-safe.</p>
  *
  * @author Brian Goetz



Mime
View raw message