Java Code Examples for org.apache.lucene.index.IndexableFieldType#indexOptions()
The following examples show how to use
org.apache.lucene.index.IndexableFieldType#indexOptions() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FieldType.java From lucene-solr with Apache License 2.0 | 6 votes |
/** * Create a new mutable FieldType with all of the properties from <code>ref</code> */ public FieldType(IndexableFieldType ref) { this.stored = ref.stored(); this.tokenized = ref.tokenized(); this.storeTermVectors = ref.storeTermVectors(); this.storeTermVectorOffsets = ref.storeTermVectorOffsets(); this.storeTermVectorPositions = ref.storeTermVectorPositions(); this.storeTermVectorPayloads = ref.storeTermVectorPayloads(); this.omitNorms = ref.omitNorms(); this.indexOptions = ref.indexOptions(); this.docValuesType = ref.docValuesType(); this.dimensionCount = ref.pointDimensionCount(); this.indexDimensionCount = ref.pointIndexDimensionCount(); this.dimensionNumBytes = ref.pointNumBytes(); if (ref.getAttributes() != null) { this.attributes = new HashMap<>(ref.getAttributes()); } // Do not copy frozen! }
Example 2
Source File: Field.java From lucene-solr with Apache License 2.0 | 6 votes |
/** * Create field with Reader value. * @param name field name * @param reader reader value * @param type field type * @throws IllegalArgumentException if either the name or type * is null, or if the field's type is stored(), or * if tokenized() is false. * @throws NullPointerException if the reader is null */ public Field(String name, Reader reader, IndexableFieldType type) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (type == null) { throw new IllegalArgumentException("type must not be null"); } if (reader == null) { throw new NullPointerException("reader must not be null"); } if (type.stored()) { throw new IllegalArgumentException("fields with a Reader value cannot be stored"); } if (type.indexOptions() != IndexOptions.NONE && !type.tokenized()) { throw new IllegalArgumentException("non-tokenized fields must use String values"); } this.name = name; this.fieldsData = reader; this.type = type; }
Example 3
Source File: Field.java From lucene-solr with Apache License 2.0 | 6 votes |
/** * Create field with TokenStream value. * @param name field name * @param tokenStream TokenStream value * @param type field type * @throws IllegalArgumentException if either the name or type * is null, or if the field's type is stored(), or * if tokenized() is false, or if indexed() is false. * @throws NullPointerException if the tokenStream is null */ public Field(String name, TokenStream tokenStream, IndexableFieldType type) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (tokenStream == null) { throw new NullPointerException("tokenStream must not be null"); } if (type.indexOptions() == IndexOptions.NONE || !type.tokenized()) { throw new IllegalArgumentException("TokenStream fields must be indexed and tokenized"); } if (type.stored()) { throw new IllegalArgumentException("TokenStream fields cannot be stored"); } this.name = name; this.fieldsData = null; this.tokenStream = tokenStream; this.type = type; }
Example 4
Source File: Field.java From lucene-solr with Apache License 2.0 | 6 votes |
/** * Create field with String value. * @param name field name * @param value string value * @param type field type * @throws IllegalArgumentException if either the name, value or type * is null, or if the field's type is neither indexed() nor stored(), * or if indexed() is false but storeTermVectors() is true. */ public Field(String name, CharSequence value, IndexableFieldType type) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (value == null) { throw new IllegalArgumentException("value must not be null"); } if (type == null) { throw new IllegalArgumentException("type must not be null"); } if (!type.stored() && type.indexOptions() == IndexOptions.NONE) { throw new IllegalArgumentException("it doesn't make sense to have a field that " + "is neither indexed nor stored"); } this.name = name; this.fieldsData = value; this.type = type; }