lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r923411 - in /lucene/solr/branches/solr: example/solr/conf/ src/common/org/apache/solr/common/luke/ src/java/org/apache/solr/handler/admin/ src/java/org/apache/solr/schema/
Date Mon, 15 Mar 2010 19:56:25 GMT
Author: markrmiller
Date: Mon Mar 15 19:56:25 2010
New Revision: 923411

URL: http://svn.apache.org/viewvc?rev=923411&view=rev
Log:
drop old style Lucene compression support - but allow older configs to still work

Removed:
    lucene/solr/branches/solr/src/java/org/apache/solr/schema/CompressableField.java
Modified:
    lucene/solr/branches/solr/example/solr/conf/schema.xml
    lucene/solr/branches/solr/src/common/org/apache/solr/common/luke/FieldFlag.java
    lucene/solr/branches/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
    lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldProperties.java
    lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldType.java
    lucene/solr/branches/solr/src/java/org/apache/solr/schema/SchemaField.java
    lucene/solr/branches/solr/src/java/org/apache/solr/schema/StrField.java
    lucene/solr/branches/solr/src/java/org/apache/solr/schema/TextField.java

Modified: lucene/solr/branches/solr/example/solr/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/example/solr/conf/schema.xml?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/example/solr/conf/schema.xml (original)
+++ lucene/solr/branches/solr/example/solr/conf/schema.xml Mon Mar 15 19:56:25 2010
@@ -45,7 +45,7 @@
     that avoids logging every request
 -->
 
-<schema name="example" version="1.2">
+<schema name="example" version="1.3">
   <!-- attribute "name" is the name of this schema and is only used for display purposes.
        Applications should change this to reflect the nature of the search collection.
        version="1.2" is Solr's version number for the schema syntax and semantics.  It should
@@ -53,6 +53,7 @@
        1.0: multiValued attribute did not exist, all fields are multiValued by nature
        1.1: multiValued attribute introduced, false by default 
        1.2: omitTermFreqAndPositions attribute introduced, true by default except for text
fields.
+       1.3: removed optional field compress feature
      -->
 
   <types>
@@ -64,11 +65,7 @@
        org.apache.solr.analysis package.
     -->
 
-    <!-- The StrField type is not analyzed, but indexed/stored verbatim.  
-       - StrField and TextField support an optional compressThreshold which
-       limits compression (if enabled in the derived fields) to values which
-       exceed a certain size (in characters).
-    -->
+    <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
     <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
 
     <!-- boolean type: "true" or "false" -->
@@ -436,9 +433,6 @@
        <types> section
      indexed: true if this field should be indexed (searchable or sortable)
      stored: true if this field should be retrievable
-     compressed: [false] if this field should be stored using gzip compression
-       (this will only apply if the field type is compressable; among
-       the standard field types, only TextField and StrField are)
      multiValued: true if this field may contain multiple values per document
      omitNorms: (expert) set to true to omit the norms associated with
        this field (this disables length normalization and index-time

Modified: lucene/solr/branches/solr/src/common/org/apache/solr/common/luke/FieldFlag.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/common/org/apache/solr/common/luke/FieldFlag.java?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/common/org/apache/solr/common/luke/FieldFlag.java (original)
+++ lucene/solr/branches/solr/src/common/org/apache/solr/common/luke/FieldFlag.java Mon Mar
15 19:56:25 2010
@@ -33,7 +33,6 @@ public enum FieldFlag {
   OMIT_TF('F', "Omit Tf"), 
   LAZY('L', "Lazy"), 
   BINARY('B', "Binary"), 
-  COMPRESSED('C', "Compressed"),
   SORT_MISSING_FIRST('f', "Sort Missing First"), 
   SORT_MISSING_LAST('l', "Sort Missing Last");
 

Modified: lucene/solr/branches/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
(original)
+++ lucene/solr/branches/solr/src/java/org/apache/solr/handler/admin/LukeRequestHandler.java
Mon Mar 15 19:56:25 2010
@@ -172,8 +172,6 @@ public class LukeRequestHandler extends 
     flags.append( (f != null && f.getOmitNorms())                  ? FieldFlag.OMIT_NORMS.getAbbreviation()
: '-' );
     flags.append( (f != null && f.isLazy())                        ? FieldFlag.LAZY.getAbbreviation()
: '-' );
     flags.append( (f != null && f.isBinary())                      ? FieldFlag.BINARY.getAbbreviation()
: '-' );
-    //nocommit: handle compressed
-    //flags.append( (f != null && f.isCompressed())                  ? FieldFlag.COMPRESSED.getAbbreviation()
: '-' );
     flags.append( (false)                                          ? FieldFlag.SORT_MISSING_FIRST.getAbbreviation()
: '-' ); // SchemaField Specific
     flags.append( (false)                                          ? FieldFlag.SORT_MISSING_LAST.getAbbreviation()
: '-' ); // SchemaField Specific
     return flags.toString();
@@ -202,7 +200,6 @@ public class LukeRequestHandler extends 
     flags.append( (f != null && f.omitTf())              ? FieldFlag.OMIT_TF.getAbbreviation()
: '-' );
     flags.append( (lazy)                                 ? FieldFlag.LAZY.getAbbreviation()
: '-' );
     flags.append( (binary)                               ? FieldFlag.BINARY.getAbbreviation()
: '-' );
-    flags.append( (f != null && f.isCompressed())        ? FieldFlag.COMPRESSED.getAbbreviation()
: '-' );
     flags.append( (f != null && f.sortMissingFirst() )   ? FieldFlag.SORT_MISSING_FIRST.getAbbreviation()
: '-' );
     flags.append( (f != null && f.sortMissingLast() )    ? FieldFlag.SORT_MISSING_LAST.getAbbreviation()
: '-' );
     return flags.toString();
@@ -224,7 +221,6 @@ public class LukeRequestHandler extends 
     key.add( String.valueOf(FieldFlag.OMIT_NORMS.getAbbreviation()), FieldFlag.OMIT_NORMS.getDisplay()
);
     key.add( String.valueOf(FieldFlag.LAZY.getAbbreviation()), FieldFlag.LAZY.getDisplay()
);
     key.add( String.valueOf(FieldFlag.BINARY.getAbbreviation()), FieldFlag.BINARY.getDisplay()
);
-    key.add( String.valueOf(FieldFlag.COMPRESSED.getAbbreviation()), FieldFlag.COMPRESSED.getDisplay()
);
     key.add( String.valueOf(FieldFlag.SORT_MISSING_FIRST.getAbbreviation()), FieldFlag.SORT_MISSING_FIRST.getDisplay()
);
     key.add( String.valueOf(FieldFlag.SORT_MISSING_LAST.getAbbreviation()), FieldFlag.SORT_MISSING_LAST.getDisplay()
);
     return key;

Modified: lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldProperties.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldProperties.java?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldProperties.java (original)
+++ lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldProperties.java Mon Mar
15 19:56:25 2010
@@ -33,23 +33,22 @@ abstract class FieldProperties {
   final static int TOKENIZED           = 0x00000002;
   final static int STORED              = 0x00000004;
   final static int BINARY              = 0x00000008;
-  final static int COMPRESSED          = 0x00000010;
-  final static int OMIT_NORMS          = 0x00000020;
-  final static int OMIT_TF_POSITIONS   = 0x00000040;
-  final static int STORE_TERMVECTORS   = 0x00000080;
-  final static int STORE_TERMPOSITIONS = 0x00000100;
-  final static int STORE_TERMOFFSETS   = 0x00000200;
+  final static int OMIT_NORMS          = 0x00000010;
+  final static int OMIT_TF_POSITIONS   = 0x00000020;
+  final static int STORE_TERMVECTORS   = 0x00000040;
+  final static int STORE_TERMPOSITIONS = 0x00000080;
+  final static int STORE_TERMOFFSETS   = 0x00000100;
 
 
-  final static int MULTIVALUED         = 0x00000400;
-  final static int SORT_MISSING_FIRST  = 0x00000800;
-  final static int SORT_MISSING_LAST   = 0x00001000;
+  final static int MULTIVALUED         = 0x00000200;
+  final static int SORT_MISSING_FIRST  = 0x00000400;
+  final static int SORT_MISSING_LAST   = 0x00000800;
   
-  final static int REQUIRED            = 0x00002000;
+  final static int REQUIRED            = 0x00001000;
   
   static final String[] propertyNames = {
           "indexed", "tokenized", "stored",
-          "binary", "compressed", "omitNorms", "omitTermFreqAndPositions",
+          "binary", "omitNorms", "omitTermFreqAndPositions",
           "termVectors", "termPositions", "termOffsets",
           "multiValued",
           "sortMissingFirst","sortMissingLast","required"

Modified: lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldType.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldType.java?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldType.java (original)
+++ lucene/solr/branches/solr/src/java/org/apache/solr/schema/FieldType.java Mon Mar 15 19:56:25
2010
@@ -127,8 +127,12 @@ public abstract class FieldType extends 
   void setArgs(IndexSchema schema, Map<String,String> args) {
     // default to STORED, INDEXED, OMIT_TF_POSITIONS and MULTIVALUED depending on schema
version
     properties = (STORED | INDEXED);
-    if (schema.getVersion()< 1.1f) properties |= MULTIVALUED;
-    if (schema.getVersion()> 1.1f) properties |= OMIT_TF_POSITIONS;
+    float schemaVersion = schema.getVersion();
+    if (schemaVersion < 1.1f) properties |= MULTIVALUED;
+    if (schemaVersion > 1.1f) properties |= OMIT_TF_POSITIONS;
+    if (schemaVersion < 1.3) {
+      args.remove("compressThreshold");
+    }
 
     this.args=args;
     Map<String,String> initArgs = new HashMap<String,String>(args);

Modified: lucene/solr/branches/solr/src/java/org/apache/solr/schema/SchemaField.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/java/org/apache/solr/schema/SchemaField.java?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/java/org/apache/solr/schema/SchemaField.java (original)
+++ lucene/solr/branches/solr/src/java/org/apache/solr/schema/SchemaField.java Mon Mar 15
19:56:25 2010
@@ -83,7 +83,6 @@ public final class SchemaField extends F
   public boolean multiValued() { return (properties & MULTIVALUED)!=0; }
   public boolean sortMissingFirst() { return (properties & SORT_MISSING_FIRST)!=0; }
   public boolean sortMissingLast() { return (properties & SORT_MISSING_LAST)!=0; }
-  public boolean isCompressed() { return (properties & COMPRESSED)!=0; }
   public boolean isRequired() { return required; } 
 
   // things that should be determined by field type, not set as options
@@ -166,7 +165,7 @@ public final class SchemaField extends F
     // that depend on that.
     //
     if (on(falseProps,STORED)) {
-      int pp = STORED | BINARY | COMPRESSED;
+      int pp = STORED | BINARY;
       if (on(pp,trueProps)) {
         throw new RuntimeException("SchemaField: " + name + " conflicting stored field options:"
+ props);
       }

Modified: lucene/solr/branches/solr/src/java/org/apache/solr/schema/StrField.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/java/org/apache/solr/schema/StrField.java?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/java/org/apache/solr/schema/StrField.java (original)
+++ lucene/solr/branches/solr/src/java/org/apache/solr/schema/StrField.java Mon Mar 15 19:56:25
2010
@@ -33,7 +33,7 @@ import java.io.IOException;
 /**
  * @version $Id$
  */
-public class StrField extends CompressableField {
+public class StrField extends FieldType {
   protected void init(IndexSchema schema, Map<String,String> args) {
     super.init(schema, args);    
   }

Modified: lucene/solr/branches/solr/src/java/org/apache/solr/schema/TextField.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/solr/src/java/org/apache/solr/schema/TextField.java?rev=923411&r1=923410&r2=923411&view=diff
==============================================================================
--- lucene/solr/branches/solr/src/java/org/apache/solr/schema/TextField.java (original)
+++ lucene/solr/branches/solr/src/java/org/apache/solr/schema/TextField.java Mon Mar 15 19:56:25
2010
@@ -45,7 +45,7 @@ import java.io.StringReader;
  * Analyzers for field types using this implementation should be defined in the schema.
  * @version $Id$
  */
-public class TextField extends CompressableField {
+public class TextField extends FieldType {
   protected void init(IndexSchema schema, Map<String,String> args) {
     properties |= TOKENIZED;
     if (schema.getVersion()> 1.1f) properties &= ~OMIT_TF_POSITIONS;



Mime
View raw message