mirror of https://github.com/apache/lucene.git
document the slightly confusing situation of parsing dates in range queries
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@369559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc4581f6d9
commit
5a8e468d3c
|
@ -44,6 +44,15 @@ import org.apache.lucene.util.Parameter;
|
|||
* 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>
|
||||
*
|
||||
|
|
|
@ -68,6 +68,15 @@ import org.apache.lucene.util.Parameter;
|
|||
* 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
|
||||
|
|
Loading…
Reference in New Issue