You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2013/02/22 02:22:59 UTC
svn commit: r1448879 - in /lucene/dev/trunk/solr:
core/src/java/org/apache/solr/schema/ example/example-DIH/solr/db/conf/
example/example-DIH/solr/solr/conf/ example/solr/collection1/conf/
Author: hossman
Date: Fri Feb 22 01:22:59 2013
New Revision: 1448879
URL: http://svn.apache.org/r1448879
Log:
SOLR-4472: jdoc updates for DateField and UUIDField refering to TimestampUpdateProcessorFactory and UUIDUpdateProcessorFactory
Modified:
lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/DateField.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieDateField.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/UUIDField.java
lucene/dev/trunk/solr/example/example-DIH/solr/db/conf/schema.xml
lucene/dev/trunk/solr/example/example-DIH/solr/solr/conf/schema.xml
lucene/dev/trunk/solr/example/solr/collection1/conf/schema.xml
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/DateField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/DateField.java?rev=1448879&r1=1448878&r2=1448879&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/DateField.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/DateField.java Fri Feb 22 01:22:59 2013
@@ -37,6 +37,7 @@ import org.apache.solr.request.SolrQuery
import org.apache.solr.response.TextResponseWriter;
import org.apache.solr.search.QParser;
import org.apache.solr.util.DateMathParser;
+import org.apache.solr.update.processor.TimestampUpdateProcessorFactory; //jdoc
import java.io.IOException;
import java.text.*;
@@ -85,6 +86,13 @@ import java.util.*;
* ie: "NOW+1YEAR", "NOW/DAY", "1995-12-31T23:59:59.999Z+5MINUTES", etc...
* -- see {@link DateMathParser} for more examples.
* </p>
+ * <p>
+ * <b>NOTE:</b> Allthough it is possible to configure a <code>DateField</code>
+ * instance with a default value of "<code>NOW</code>" to compute a timestamp
+ * of when the document was indexed, this is not advisable when using SolrCloud
+ * since each replica of the document may compute a slightly different value.
+ * {@link TimestampUpdateProcessorFactory} is recomended instead.
+ * </p>
*
* <p>
* Explanation of "UTC"...
@@ -101,7 +109,7 @@ import java.util.*;
*
*
* @see <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">XML schema part 2</a>
- *
+ * @deprecated {@link TrieDateField} is recomended for all new schemas
*/
public class DateField extends PrimitiveFieldType {
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieDateField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieDateField.java?rev=1448879&r1=1448878&r2=1448879&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieDateField.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/TrieDateField.java Fri Feb 22 01:22:59 2013
@@ -17,14 +17,15 @@
package org.apache.solr.schema;
-import org.apache.lucene.queries.function.FunctionValues;
-import org.apache.lucene.queries.function.ValueSource;
import org.apache.solr.search.QParser;
import org.apache.solr.common.SolrException;
import org.apache.solr.response.TextResponseWriter;
+import org.apache.solr.update.processor.TimestampUpdateProcessorFactory; //jdoc
import org.apache.lucene.document.FieldType.NumericType;
import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.StorableField;
+import org.apache.lucene.queries.function.FunctionValues;
+import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.NumericRangeQuery;
@@ -36,6 +37,24 @@ import java.util.Map;
import java.util.Date;
import java.io.IOException;
+/**
+ * <p>
+ * An extension of {@link DateField} that supports the same values and
+ * syntax, but indexes the value more efficiently using a numeric
+ * {@link TrieField} under the covers. See the description of
+ * {@link DateField} for more details of the supported usage.
+ * </p>
+ * <p>
+ * <b>NOTE:</b> Allthough it is possible to configure a <code>TrieDateField</code>
+ * instance with a default value of "<code>NOW</code>" to compute a timestamp
+ * of when the document was indexed, this is not advisable when using SolrCloud
+ * since each replica of the document may compute a slightly different value.
+ * {@link TimestampUpdateProcessorFactory} is recomended instead.
+ * </p>
+ *
+ * @see DateField
+ * @see TrieField
+ */
public class TrieDateField extends DateField {
final TrieField wrappedField = new TrieField() {{
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/UUIDField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/UUIDField.java?rev=1448879&r1=1448878&r2=1448879&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/UUIDField.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/UUIDField.java Fri Feb 22 01:22:59 2013
@@ -26,11 +26,22 @@ import org.apache.lucene.index.StorableF
import org.apache.lucene.search.SortField;
import org.apache.solr.common.SolrException;
import org.apache.solr.response.TextResponseWriter;
-
+import org.apache.solr.update.processor.UUIDUpdateProcessorFactory; // jdoc
/**
+ * <p>
* This FieldType accepts UUID string values, as well as the special value
* of "NEW" which triggers generation of a new random UUID.
- *
+ * </p>
+ * <p>
+ * <b>NOTE:</b> Configuring a <code>UUIDField</code>
+ * instance with a default value of "<code>NEW</code>" is not advisable for
+ * most users when using SolrCloud (and not possible if the UUID value is
+ * configured as the unique key field) since the result will be that each
+ * replica of each document will get a unique UUID value.
+ * Using {@link UUIDUpdateProcessorFactory} to generate UUID values when
+ * documents are added is recomended instead.
+ * </p>
+ *
* @see UUID#toString
* @see UUID#randomUUID
*
Modified: lucene/dev/trunk/solr/example/example-DIH/solr/db/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/example-DIH/solr/db/conf/schema.xml?rev=1448879&r1=1448878&r2=1448879&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/example-DIH/solr/db/conf/schema.xml (original)
+++ lucene/dev/trunk/solr/example/example-DIH/solr/db/conf/schema.xml Fri Feb 22 01:22:59 2013
@@ -293,12 +293,6 @@
results by manufacturer. copied from "manu" via copyField -->
<field name="manu_exact" type="string" indexed="true" stored="false"/>
- <!-- Here, default is used to create a "timestamp" field indicating
- When each document was indexed.
- -->
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
-
-
<!-- Dynamic field definitions. If a field name is not found, dynamicFields
will be used if the name matches any of the patterns.
RESTRICTION: the glob-like pattern in the name attribute must have
Modified: lucene/dev/trunk/solr/example/example-DIH/solr/solr/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/example-DIH/solr/solr/conf/schema.xml?rev=1448879&r1=1448878&r2=1448879&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/example-DIH/solr/solr/conf/schema.xml (original)
+++ lucene/dev/trunk/solr/example/example-DIH/solr/solr/conf/schema.xml Fri Feb 22 01:22:59 2013
@@ -293,12 +293,6 @@
results by manufacturer. copied from "manu" via copyField -->
<field name="manu_exact" type="string" indexed="true" stored="false"/>
- <!-- Here, default is used to create a "timestamp" field indicating
- When each document was indexed.
- -->
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
-
-
<!-- Dynamic field definitions. If a field name is not found, dynamicFields
will be used if the name matches any of the patterns.
RESTRICTION: the glob-like pattern in the name attribute must have
Modified: lucene/dev/trunk/solr/example/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/example/solr/collection1/conf/schema.xml?rev=1448879&r1=1448878&r2=1448879&view=diff
==============================================================================
--- lucene/dev/trunk/solr/example/solr/collection1/conf/schema.xml (original)
+++ lucene/dev/trunk/solr/example/solr/collection1/conf/schema.xml Fri Feb 22 01:22:59 2013
@@ -176,13 +176,6 @@
NRT-friendly.
-->
- <!-- Uncommenting the following will create a "timestamp" field using
- a default value of "NOW" to indicate when each document was indexed.
- -->
- <!--
- <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
- -->
-
<!-- Dynamic field definitions allow using convention over configuration
for fields via the specification of patterns to match field names.
EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)