lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject lucene-solr:master: SOLR-9579: SchemaField should implement lucene.IndexableFieldType to avoid repeated creation
Date Tue, 11 Oct 2016 15:47:53 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 8648fd5e8 -> 98191225e


SOLR-9579: SchemaField should implement lucene.IndexableFieldType to avoid repeated creation


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/98191225
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/98191225
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/98191225

Branch: refs/heads/master
Commit: 98191225eb3ed4b2938a7ce27128a6a9b0e22590
Parents: 8648fd5
Author: yonik <yonik@apache.org>
Authored: Tue Oct 11 11:00:05 2016 -0400
Committer: yonik <yonik@apache.org>
Committed: Tue Oct 11 11:17:55 2016 -0400

----------------------------------------------------------------------
 .../org/apache/lucene/document/BinaryPoint.java |  3 +-
 .../java/org/apache/lucene/document/Field.java  | 18 +++---
 .../apache/lucene/index/TestBagOfPositions.java |  4 +-
 .../analysis/BaseTokenStreamTestCase.java       |  3 +-
 solr/CHANGES.txt                                |  4 ++
 .../org/apache/solr/schema/CurrencyField.java   |  6 +-
 .../java/org/apache/solr/schema/EnumField.java  |  3 +-
 .../java/org/apache/solr/schema/FieldType.java  | 37 ++++--------
 .../java/org/apache/solr/schema/LatLonType.java |  5 +-
 .../java/org/apache/solr/schema/PointType.java  |  5 +-
 .../apache/solr/schema/PreAnalyzedField.java    |  4 +-
 .../org/apache/solr/schema/SchemaField.java     | 63 +++++++++++++++++++-
 .../java/org/apache/solr/schema/TrieField.java  |  2 +-
 13 files changed, 102 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java b/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
index 3388170..81ef092 100644
--- a/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
+++ b/lucene/core/src/java/org/apache/lucene/document/BinaryPoint.java
@@ -19,6 +19,7 @@ package org.apache.lucene.document;
 import java.util.Arrays;
 import java.util.Comparator;
 
+import org.apache.lucene.index.IndexableFieldType;
 import org.apache.lucene.index.PointValues;
 import org.apache.lucene.search.MatchNoDocsQuery;
 import org.apache.lucene.search.PointInSetQuery;
@@ -121,7 +122,7 @@ public final class BinaryPoint extends Field {
   }
 
   /** Expert API */
-  public BinaryPoint(String name, byte[] packedPoint, FieldType type) {
+  public BinaryPoint(String name, byte[] packedPoint, IndexableFieldType type) {
     super(name, packedPoint, type);
     if (packedPoint.length != type.pointDimensionCount() * type.pointNumBytes()) {
       throw new IllegalArgumentException("packedPoint is length=" + packedPoint.length +
" but type.pointDimensionCount()=" + type.pointDimensionCount() + " and type.pointNumBytes()="
+ type.pointNumBytes());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/lucene/core/src/java/org/apache/lucene/document/Field.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/document/Field.java b/lucene/core/src/java/org/apache/lucene/document/Field.java
index 8f5f869..fa3f5a7 100644
--- a/lucene/core/src/java/org/apache/lucene/document/Field.java
+++ b/lucene/core/src/java/org/apache/lucene/document/Field.java
@@ -64,7 +64,7 @@ public class Field implements IndexableField {
   /**
    * Field's type
    */
-  protected final FieldType type;
+  protected final IndexableFieldType type;
 
   /**
    * Field's name
@@ -94,7 +94,7 @@ public class Field implements IndexableField {
    * @throws IllegalArgumentException if either the name or type
    *         is null.
    */
-  protected Field(String name, FieldType type) {
+  protected Field(String name, IndexableFieldType type) {
     if (name == null) {
       throw new IllegalArgumentException("name must not be null");
     }
@@ -115,7 +115,7 @@ public class Field implements IndexableField {
    *         if tokenized() is false.
    * @throws NullPointerException if the reader is null
    */
-  public Field(String name, Reader reader, FieldType type) {
+  public Field(String name, Reader reader, IndexableFieldType type) {
     if (name == null) {
       throw new IllegalArgumentException("name must not be null");
     }
@@ -147,7 +147,7 @@ public class Field implements IndexableField {
    *         if tokenized() is false, or if indexed() is false.
    * @throws NullPointerException if the tokenStream is null
    */
-  public Field(String name, TokenStream tokenStream, FieldType type) {
+  public Field(String name, TokenStream tokenStream, IndexableFieldType type) {
     if (name == null) {
       throw new IllegalArgumentException("name must not be null");
     }
@@ -179,7 +179,7 @@ public class Field implements IndexableField {
    *         or the field's type is indexed()
    * @throws NullPointerException if the type is null
    */
-  public Field(String name, byte[] value, FieldType type) {
+  public Field(String name, byte[] value, IndexableFieldType type) {
     this(name, value, 0, value.length, type);
   }
 
@@ -197,7 +197,7 @@ public class Field implements IndexableField {
    *         or the field's type is indexed()
    * @throws NullPointerException if the type is null
    */
-  public Field(String name, byte[] value, int offset, int length, FieldType type) {
+  public Field(String name, byte[] value, int offset, int length, IndexableFieldType type)
{
     this(name, new BytesRef(value, offset, length), type);
   }
 
@@ -213,7 +213,7 @@ public class Field implements IndexableField {
    *         or the field's type is indexed()
    * @throws NullPointerException if the type is null
    */
-  public Field(String name, BytesRef bytes, FieldType type) {
+  public Field(String name, BytesRef bytes, IndexableFieldType type) {
     if (name == null) {
       throw new IllegalArgumentException("name must not be null");
     }
@@ -237,7 +237,7 @@ public class Field implements IndexableField {
    *         or if indexed() is false but storeTermVectors() is true.
    * @throws NullPointerException if the type is null
    */
-  public Field(String name, String value, FieldType type) {
+  public Field(String name, String value, IndexableFieldType type) {
     if (name == null) {
       throw new IllegalArgumentException("name must not be null");
     }
@@ -496,7 +496,7 @@ public class Field implements IndexableField {
   
   /** Returns the {@link FieldType} for this field. */
   @Override
-  public FieldType fieldType() {
+  public IndexableFieldType fieldType() {
     return type;
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
index 1648408..6214e4c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
@@ -28,6 +28,7 @@ import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.TextField;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
@@ -77,8 +78,7 @@ public class TestBagOfPositions extends LuceneTestCase {
       System.out.println("threadCount=" + threadCount);
     }
     
-    Field prototype = newTextField("field", "", Field.Store.NO);
-    FieldType fieldType = new FieldType(prototype.fieldType());
+    FieldType fieldType = new FieldType(TextField.TYPE_NOT_STORED);
     if (random().nextBoolean()) {
       fieldType.setOmitNorms(true);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
b/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
index 0bb623f..5fd2fef 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/analysis/BaseTokenStreamTestCase.java
@@ -34,6 +34,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.IndexOptions;
+import org.apache.lucene.index.IndexableFieldType;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Attribute;
@@ -628,7 +629,7 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase {
           if (iw != null) {
             if (random.nextInt(7) == 0) {
               // pile up a multivalued field
-              FieldType ft = field.fieldType();
+              IndexableFieldType ft = field.fieldType();
               currentField = new Field("dummy", bogus, ft);
               doc.add(currentField);
             } else {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 74851a7..271cec4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -53,6 +53,10 @@ Optimizations
   check on every request and move connection lifecycle management towards the client.
   (Ryan Zezeski, Mark Miller, Shawn Heisey, Steve Davids)
 
+* SOLR-9579: Make Solr's SchemaField implement Lucene's IndexableFieldType, removing the

+  creation of a Lucene FieldType every time a field is indexed. (John Call, yonik) 
+
+
 ==================  6.3.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/CurrencyField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/CurrencyField.java b/solr/core/src/java/org/apache/solr/schema/CurrencyField.java
index 787599a..7ad285b 100644
--- a/solr/core/src/java/org/apache/solr/schema/CurrencyField.java
+++ b/solr/core/src/java/org/apache/solr/schema/CurrencyField.java
@@ -35,6 +35,7 @@ import javax.xml.xpath.XPathFactory;
 
 import org.apache.lucene.analysis.util.ResourceLoader;
 import org.apache.lucene.analysis.util.ResourceLoaderAware;
+import org.apache.lucene.document.StoredField;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.queries.function.FunctionValues;
@@ -180,14 +181,11 @@ public class CurrencyField extends FieldType implements SchemaAware,
ResourceLoa
     f.add(currencyField.createField(value.getCurrencyCode(), currencyField.indexed() &&
!currencyField.omitNorms() ? boost : 1F));
 
     if (field.stored()) {
-      org.apache.lucene.document.FieldType customType = new org.apache.lucene.document.FieldType();
-      assert !customType.omitNorms();
-      customType.setStored(true);
       String storedValue = externalVal.toString().trim();
       if (storedValue.indexOf(",") < 0) {
         storedValue += "," + defaultCurrency;
       }
-      f.add(createField(field.getName(), storedValue, customType, 1F));
+      f.add(createField(field.getName(), storedValue, StoredField.TYPE, 1F));
     }
 
     return f;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/EnumField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/EnumField.java b/solr/core/src/java/org/apache/solr/schema/EnumField.java
index 4820e77..16c6959 100644
--- a/solr/core/src/java/org/apache/solr/schema/EnumField.java
+++ b/solr/core/src/java/org/apache/solr/schema/EnumField.java
@@ -387,13 +387,12 @@ public class EnumField extends PrimitiveFieldType {
     if (intValue == null || intValue.equals(DEFAULT_VALUE))
       throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown value for enum
field: " + value.toString());
 
-    String intAsString =  intValue.toString();
     final LegacyFieldType newType = new LegacyFieldType();
 
     newType.setTokenized(field.isTokenized());
     newType.setStored(field.stored());
     newType.setOmitNorms(field.omitNorms());
-    newType.setIndexOptions(field.indexed() ? getIndexOptions(field, intAsString) : IndexOptions.NONE);
+    newType.setIndexOptions(field.indexOptions());
     newType.setStoreTermVectors(field.storeTermVector());
     newType.setStoreTermVectorOffsets(field.storeTermOffsets());
     newType.setStoreTermVectorPositions(field.storeTermPositions());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/FieldType.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/FieldType.java b/solr/core/src/java/org/apache/solr/schema/FieldType.java
index 32a91d9..192e7b3 100644
--- a/solr/core/src/java/org/apache/solr/schema/FieldType.java
+++ b/solr/core/src/java/org/apache/solr/schema/FieldType.java
@@ -271,17 +271,16 @@ public abstract class FieldType extends FieldProperties {
     }
     if (val==null) return null;
 
-    org.apache.lucene.document.FieldType newType = new org.apache.lucene.document.FieldType();
-    newType.setTokenized(field.isTokenized());
-    newType.setStored(field.stored());
-    newType.setOmitNorms(field.omitNorms());
-    newType.setIndexOptions(field.indexed() ? getIndexOptions(field, val) : IndexOptions.NONE);
-    newType.setStoreTermVectors(field.storeTermVector());
-    newType.setStoreTermVectorOffsets(field.storeTermOffsets());
-    newType.setStoreTermVectorPositions(field.storeTermPositions());
-    newType.setStoreTermVectorPayloads(field.storeTermPayloads());
-
-    return createField(field.getName(), val, newType, boost);
+      /*org.apache.lucene.document.FieldType newType = new org.apache.lucene.document.FieldType();
+      newType.setTokenized(field.isTokenized());
+      newType.setStored(field.stored());
+      newType.setOmitNorms(field.omitNorms());
+      newType.setIndexOptions(field.indexed() ? getIndexOptions(field, val) : IndexOptions.NONE);
+      newType.setStoreTermVectors(field.storeTermVector());
+      newType.setStoreTermVectorOffsets(field.storeTermOffsets());
+      newType.setStoreTermVectorPositions(field.storeTermPositions());
+      newType.setStoreTermVectorPayloads(field.storeTermPayloads());*/
+    return createField(field.getName(), val, field, boost);
   }
 
   /**
@@ -293,7 +292,7 @@ public abstract class FieldType extends FieldProperties {
    * @param boost The boost value
    * @return the {@link org.apache.lucene.index.IndexableField}.
    */
-  protected IndexableField createField(String name, String val, org.apache.lucene.document.FieldType
type, float boost){
+  protected IndexableField createField(String name, String val, org.apache.lucene.index.IndexableFieldType
type, float boost){
     Field f = new Field(name, val, type);
     f.setBoost(boost);
     return f;
@@ -320,20 +319,6 @@ public abstract class FieldType extends FieldProperties {
     return f==null ? Collections.<IndexableField>emptyList() : Collections.singletonList(f);
   }
 
-  protected IndexOptions getIndexOptions(SchemaField field, String internalVal) {
-
-    IndexOptions options = IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
-    if (field.omitTermFreqAndPositions()) {
-      options = IndexOptions.DOCS;
-    } else if (field.omitPositions()) {
-      options = IndexOptions.DOCS_AND_FREQS;
-    } else if (field.storeOffsetsWithPositions()) {
-      options = IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS;
-    }
-
-    return options;
-  }
-
   /**
    * Convert an external value (from XML update command or from query string)
    * into the internal format for both storing and indexing (which can be modified by any
analyzers).

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/LatLonType.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/LatLonType.java b/solr/core/src/java/org/apache/solr/schema/LatLonType.java
index 53935b8..db4d9da 100644
--- a/solr/core/src/java/org/apache/solr/schema/LatLonType.java
+++ b/solr/core/src/java/org/apache/solr/schema/LatLonType.java
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.StoredField;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.index.LeafReaderContext;
@@ -82,9 +83,7 @@ public class LatLonType extends AbstractSubTypeFieldType implements SpatialQuery
     }
 
     if (field.stored()) {
-      FieldType customType = new FieldType();
-      customType.setStored(true);
-      f.add(createField(field.getName(), externalVal, customType, 1f));
+      f.add(createField(field.getName(), externalVal, StoredField.TYPE, 1f));
     }
     return f;
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/PointType.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/PointType.java b/solr/core/src/java/org/apache/solr/schema/PointType.java
index df5559a..afbfeec 100644
--- a/solr/core/src/java/org/apache/solr/schema/PointType.java
+++ b/solr/core/src/java/org/apache/solr/schema/PointType.java
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.StoredField;
 import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.queries.function.ValueSource;
 import org.apache.lucene.queries.function.valuesource.VectorValueSource;
@@ -82,9 +83,7 @@ public class PointType extends CoordinateFieldType implements SpatialQueryable
{
 
     if (field.stored()) {
       String storedVal = externalVal;  // normalize or not?
-      FieldType customType = new FieldType();
-      customType.setStored(true);
-      f.add(createField(field.getName(), storedVal, customType, 1f));
+      f.add(createField(field.getName(), storedVal, StoredField.TYPE, 1f));
     }
     
     return f;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java b/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java
index 09d3590..7bfed2b 100644
--- a/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java
+++ b/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java
@@ -263,8 +263,8 @@ public class PreAnalyzedField extends TextField {
         }
       } else {
         if (f != null) {
-          f.fieldType().setIndexOptions(IndexOptions.NONE);
-          f.fieldType().setTokenized(false);
+          type.setIndexOptions(IndexOptions.NONE);
+          type.setTokenized(false);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/SchemaField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/SchemaField.java b/solr/core/src/java/org/apache/solr/schema/SchemaField.java
index 5aadeda..bcd68c2 100644
--- a/solr/core/src/java/org/apache/solr/schema/SchemaField.java
+++ b/solr/core/src/java/org/apache/solr/schema/SchemaField.java
@@ -22,7 +22,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.lucene.index.DocValuesType;
+import org.apache.lucene.index.IndexOptions;
 import org.apache.lucene.index.IndexableField;
+import org.apache.lucene.index.IndexableFieldType;
 import org.apache.lucene.search.SortField;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.util.SimpleOrderedMap;
@@ -33,7 +36,7 @@ import org.apache.solr.response.TextResponseWriter;
  *
  *
  */
-public final class SchemaField extends FieldProperties {
+public final class SchemaField extends FieldProperties implements IndexableFieldType {
   private static final String FIELD_NAME = "name";
   private static final String TYPE_NAME = "type";
   private static final String DEFAULT_VALUE = "default";
@@ -353,4 +356,62 @@ public final class SchemaField extends FieldProperties {
     }
     return properties;
   }
+
+  @Override
+  public boolean tokenized() {
+    return isTokenized();
+  }
+
+  @Override
+  public boolean storeTermVectors() {
+    return storeTermVector();
+  }
+
+  @Override
+  public boolean storeTermVectorOffsets() {
+    return storeTermOffsets();
+  }
+
+  @Override
+  public boolean storeTermVectorPositions() {
+    return storeTermPositions();
+  }
+
+  @Override
+  public boolean storeTermVectorPayloads() {
+    return storeTermPayloads();
+  }
+
+  @Override
+  public IndexOptions indexOptions() {
+    if (!indexed()) {
+      return IndexOptions.NONE;
+    }
+    
+    IndexOptions options = IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
+    if (omitTermFreqAndPositions()) {
+      options = IndexOptions.DOCS;
+    } else if (omitPositions()) {
+      options = IndexOptions.DOCS_AND_FREQS;
+    } else if (storeOffsetsWithPositions()) {
+      options = IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS;
+    }
+
+    return options;
+  }
+
+  @Override
+  public DocValuesType docValuesType() {
+    return DocValuesType.NONE;
+  }
+
+  @Override
+  public int pointDimensionCount() {
+    return 0;
+  }
+
+  @Override
+  public int pointNumBytes() {
+    return 0;
+  }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98191225/solr/core/src/java/org/apache/solr/schema/TrieField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/TrieField.java b/solr/core/src/java/org/apache/solr/schema/TrieField.java
index b23a8b6..49f9315 100644
--- a/solr/core/src/java/org/apache/solr/schema/TrieField.java
+++ b/solr/core/src/java/org/apache/solr/schema/TrieField.java
@@ -670,7 +670,7 @@ public class TrieField extends PrimitiveFieldType {
     ft.setStored(stored);
     ft.setTokenized(true);
     ft.setOmitNorms(field.omitNorms());
-    ft.setIndexOptions(indexed ? getIndexOptions(field, value.toString()) : IndexOptions.NONE);
+    ft.setIndexOptions(field.indexOptions());
 
     switch (type) {
       case INTEGER:


Mime
View raw message