Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 16573 invoked from network); 16 Jan 2006 20:10:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Jan 2006 20:10:17 -0000 Received: (qmail 80949 invoked by uid 500); 16 Jan 2006 20:10:16 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 80883 invoked by uid 500); 16 Jan 2006 20:10:16 -0000 Mailing-List: contact java-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-commits@lucene.apache.org Received: (qmail 80862 invoked by uid 99); 16 Jan 2006 20:10:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jan 2006 12:10:15 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 16 Jan 2006 12:10:15 -0800 Received: (qmail 16475 invoked by uid 65534); 16 Jan 2006 20:09:54 -0000 Message-ID: <20060116200954.16472.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: java-commits@lucene.apache.org From: dnaber@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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. *

+ * + *

In {@link RangeQuery}s, QueryParser tries to detect date values, e.g. date:[6/1/2005 TO 6/4/2005] + * 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)}.

* *

Note that QueryParser is not thread-safe.

* 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. *

* + *

In {@link RangeQuery}s, QueryParser tries to detect date values, e.g. date:[6/1/2005 TO 6/4/2005] + * 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)}.

+ * *

Note that QueryParser is not thread-safe.

* * @author Brian Goetz