lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1054763 - in /lucene/dev/trunk/solr/src: java/org/apache/solr/schema/ java/org/apache/solr/update/ test/org/apache/solr/ test/org/apache/solr/update/
Date Mon, 03 Jan 2011 21:30:50 GMT
Author: yonik
Date: Mon Jan  3 21:30:50 2011
New Revision: 1054763

URL: http://svn.apache.org/viewvc?rev=1054763&view=rev
Log:
SOLR-1930: fully move from Field to Fieldable in interfaces

Modified:
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/BinaryField.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/FieldType.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/PointType.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/SchemaField.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieDateField.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieField.java
    lucene/dev/trunk/solr/src/java/org/apache/solr/update/DocumentBuilder.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/BasicFunctionalityTest.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/BinaryField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/BinaryField.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/BinaryField.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/BinaryField.java Mon Jan  3 21:30:50
2011
@@ -50,7 +50,7 @@ public class BinaryField extends FieldTy
     return  ByteBuffer.wrap(f.getBinaryValue(), f.getBinaryOffset(), f.getBinaryLength()
) ;
   }
 
-  public Field createField(SchemaField field, Object val, float boost) {
+  public Fieldable createField(SchemaField field, Object val, float boost) {
     if (val == null) return null;
     if (!field.stored()) {
       log.trace("Ignoring unstored binary field: " + field);

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/FieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/FieldType.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/FieldType.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/FieldType.java Mon Jan  3 21:30:50
2011
@@ -221,7 +221,7 @@ public abstract class FieldType extends 
    *
    *
    */
-  public Field createField(SchemaField field, String externalVal, float boost) {
+  public Fieldable createField(SchemaField field, String externalVal, float boost) {
     if (!field.indexed() && !field.stored()) {
       if (log.isTraceEnabled())
         log.trace("Ignoring unindexed/unstored field: " + field);
@@ -252,9 +252,9 @@ public abstract class FieldType extends 
    * @param omitNorms true if norms should be omitted
    * @param omitTFPos true if term freq and position should be omitted.
    * @param boost The boost value
-   * @return the {@link org.apache.lucene.document.Field}.
+   * @return the {@link org.apache.lucene.document.Fieldable}.
    */
-  protected Field createField(String name, String val, Field.Store storage, Field.Index index,
+  protected Fieldable createField(String name, String val, Field.Store storage, Field.Index
index,
                                     Field.TermVector vec, boolean omitNorms, boolean omitTFPos,
float boost){
     Field f = new Field(name,
                         val,
@@ -278,7 +278,7 @@ public abstract class FieldType extends 
    * @see #isPolyField()
    */
   public Fieldable[] createFields(SchemaField field, String externalVal, float boost) {
-    Field f = createField( field, externalVal, boost);
+    Fieldable f = createField( field, externalVal, boost);
     return f==null ? new Fieldable[]{} : new Fieldable[]{f};
   }
 
@@ -341,7 +341,7 @@ public abstract class FieldType extends 
   public Object toObject(SchemaField sf, BytesRef term) {
     CharArr ext = new CharArr(term.length);
     indexedToReadable(term, ext);
-    Field f = createField(sf, ext.toString(), 1.0f);
+    Fieldable f = createField(sf, ext.toString(), 1.0f);
     return toObject(f);
   }
 
@@ -511,7 +511,6 @@ public abstract class FieldType extends 
    * @param maxInclusive whether the maximum of the range is inclusive or not
    *  @return a Query instance to perform range search according to given parameters
    *
-   * @see org.apache.solr.search.SolrQueryParser#getRangeQuery(String, String, String, boolean)
    */
   public Query getRangeQuery(QParser parser, SchemaField field, String part1, String part2,
boolean minInclusive, boolean maxInclusive) {
     // constant score mode is now enabled per default

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/LatLonType.java Mon Jan  3 21:30:50
2011
@@ -281,7 +281,7 @@ public class LatLonType extends Abstract
   //It never makes sense to create a single field, so make it impossible to happen
 
   @Override
-  public Field createField(SchemaField field, String externalVal, float boost) {
+  public Fieldable createField(SchemaField field, String externalVal, float boost) {
     throw new UnsupportedOperationException("LatLonType uses multiple fields.  field=" +
field.getName());
   }
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/PointType.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/PointType.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/PointType.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/PointType.java Mon Jan  3 21:30:50
2011
@@ -112,7 +112,7 @@ public class PointType extends Coordinat
    *
    */
   @Override
-  public Field createField(SchemaField field, String externalVal, float boost) {
+  public Fieldable createField(SchemaField field, String externalVal, float boost) {
     throw new UnsupportedOperationException("PointType uses multiple fields.  field=" + field.getName());
   }
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/SchemaField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/SchemaField.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/SchemaField.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/SchemaField.java Mon Jan  3 21:30:50
2011
@@ -89,7 +89,7 @@ public final class SchemaField extends F
   boolean isBinary() { return (properties & BINARY)!=0; }
 
 
-  public Field createField(String val, float boost) {
+  public Fieldable createField(String val, float boost) {
     return type.createField(this,val,boost);
   }
   

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieDateField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieDateField.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieDateField.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieDateField.java Mon Jan  3 21:30:50
2011
@@ -160,7 +160,7 @@ public class TrieDateField extends DateF
   }
 
   @Override
-  public Field createField(SchemaField field, String externalVal, float boost) {
+  public Fieldable createField(SchemaField field, String externalVal, float boost) {
     boolean indexed = field.indexed();
     boolean stored = field.stored();
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieField.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieField.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/schema/TrieField.java Mon Jan  3 21:30:50
2011
@@ -477,7 +477,7 @@ public class TrieField extends FieldType
   }
 
   @Override
-  public Field createField(SchemaField field, String externalVal, float boost) {
+  public Fieldable createField(SchemaField field, String externalVal, float boost) {
     boolean indexed = field.indexed();
     boolean stored = field.stored();
 

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/update/DocumentBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/update/DocumentBuilder.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/update/DocumentBuilder.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/update/DocumentBuilder.java Mon Jan  3
21:30:50 2011
@@ -73,7 +73,7 @@ public class DocumentBuilder {
         }
       }
     } else {
-      Field field = sfield.createField(val, boost);
+      Fieldable field = sfield.createField(val, boost);
       if (field != null) {
         if (!sfield.multiValued()) {
           String oldValue = map.put(sfield.getName(), val);
@@ -201,7 +201,7 @@ public class DocumentBuilder {
         if (f != null) doc.add(f); // null fields are not added
       }
     } else {
-      Field f = field.createField(val, boost);
+      Fieldable f = field.createField(val, boost);
       if (f != null) doc.add(f);  // null fields are not added
     }
   }

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/BasicFunctionalityTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/BasicFunctionalityTest.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/BasicFunctionalityTest.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/BasicFunctionalityTest.java Mon Jan  3
21:30:50 2011
@@ -27,9 +27,8 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.Fieldable;
 import org.apache.lucene.index.LogMergePolicy;
-import org.apache.lucene.search.BooleanQuery;
-import org.apache.lucene.search.Query;
 import org.apache.solr.common.params.AppendedSolrParams;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.DefaultSolrParams;
@@ -47,7 +46,6 @@ import org.apache.solr.schema.IndexSchem
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.search.DocIterator;
 import org.apache.solr.search.DocList;
-import org.apache.solr.search.QueryParsing;
 import org.apache.solr.update.SolrIndexWriter;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -350,7 +348,7 @@ public class BasicFunctionalityTest exte
     
     IndexSchema ischema = new IndexSchema(solrConfig, getSchemaFile(), null);
     SchemaField f; // Solr field type
-    Field luf; // Lucene field
+    Fieldable luf; // Lucene field
 
     f = ischema.getField("test_basictv");
     luf = f.createField("test", 0f);

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java?rev=1054763&r1=1054762&r2=1054763&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/update/TestIndexingPerformance.java Mon
Jan  3 21:30:50 2011
@@ -19,6 +19,7 @@ package org.apache.solr.update;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.document.Fieldable;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.util.AbstractSolrTestCase;
@@ -99,7 +100,7 @@ public class TestIndexingPerformance ext
         for (int j=0; j<fields.length; j+=2) {
           String field = fields[j];
           String val = fields[j+1];
-          Field f = schema.getField(field).createField(val, 1.0f);
+          Fieldable f = schema.getField(field).createField(val, 1.0f);
           add.doc.add(f);
         }
       }



Mime
View raw message