You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2007/07/30 06:15:00 UTC
[Solr Wiki] Update of "SolrQuerySyntax" by HossMan
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by HossMan:
http://wiki.apache.org/solr/SolrQuerySyntax
------------------------------------------------------------------------------
* Example: {{{_val_:myfield}}}
* Example: {{{_val_:recip(rord(myfield),1,2,3)}}}
- Although not technically a Syntax difference, please note that if you use the Solr "[http://lucene.apache.org/solr/api/org/apache/solr/schema/DateField.html DateField]" type, any queries on those fields (typically range queries) should use either the Complete ISO 8601 Date syntax that field supports, or the [http://lucene.apache.org/solr/api/org/apache/solr/util/DateMathParser.html DateMath] Syntax to get dates relative "NOW". Examples:
+ Although not technically a Syntax difference, please note that if you use the Solr "[http://lucene.apache.org/solr/api/org/apache/solr/schema/DateField.html DateField]" type, any queries on those fields (typically range queries) should use either the Complete ISO 8601 Date syntax that field supports, or the [http://lucene.apache.org/solr/api/org/apache/solr/util/DateMathParser.html DateMath] Syntax to get relative dates. Examples:
* {{{timestamp:[* TO NOW]}}}
* {{{createdate:[1976-03-06T23:59:59.999Z TO *]}}}
* {{{createdate:[1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z]}}}
* {{{pubdate:[NOW-1YEAR/DAY TO NOW/DAY+1DAY]}}}
+ * {{{createdate:[1976-03-06T23:59:59.999Z TO 1976-03-06T23:59:59.999Z+1YEAR]}}}
+ * {{{createdate:[1976-03-06T23:59:59.999Z/YEAR TO 1976-03-06T23:59:59.999Z]}}}