Class BinaryField
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.schema.FieldType
FieldType.DefaultAnalyzer, FieldType.MultiValueSelector -
Field Summary
Fields inherited from class org.apache.solr.schema.FieldType
ANALYZER, args, AUTO_GENERATE_PHRASE_QUERIES, CHAR_FILTER, CHAR_FILTERS, CLASS_NAME, docValuesFormat, ENABLE_GRAPH_QUERIES, falseProperties, FILTER, FILTERS, INDEX, INDEX_ANALYZER, MULTI_TERM, MULTI_TERM_ANALYZER, POLY_FIELD_SEPARATOR, postingsFormat, properties, QUERY, QUERY_ANALYZER, similarity, SIMILARITY, similarityFactory, SYNONYM_QUERY_STYLE, TOKENIZER, trueProperties, TYPE, TYPE_NAME, typeNameFields inherited from class org.apache.solr.schema.FieldProperties
BINARY, DOC_VALUES, INDEXED, LARGE_FIELD, MULTIVALUED, OMIT_NORMS, OMIT_POSITIONS, OMIT_TF_POSITIONS, REQUIRED, SORT_MISSING_FIRST, SORT_MISSING_LAST, STORE_OFFSETS, STORE_TERMOFFSETS, STORE_TERMPAYLOADS, STORE_TERMPOSITIONS, STORE_TERMVECTORS, STORED, TOKENIZED, UNINVERTIBLE, USE_DOCVALUES_AS_STORED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckSchemaField(SchemaField field) Check'sSchemaFieldinstances constructed using this field type to ensure that they are valid.protected voidCalled byFieldType.checkSchemaField(SchemaField)if the field has docValues.org.apache.lucene.index.IndexableFieldcreateField(SchemaField field, Object val) Used for adding a document when a field needs to be created from a type and a string.List<org.apache.lucene.index.IndexableField> createFields(SchemaField field, Object val) Given aSchemaField, create one or moreIndexableFieldinstancesorg.apache.lucene.search.SortFieldgetSortField(SchemaField field, boolean top) Returns the SortField instance that should be used to sort fields of this type.If DocValues is not enabled for a field, but it's indexed, docvalues can be constructed on the fly (uninverted, aka fieldcache) on the first request to sort, facet, etc.toExternal(org.apache.lucene.index.IndexableField f) Convert the stored-field format to an external (string, human readable) valuetoNativeType(Object val) Converts any Object to a java Object native to this field typetoObject(org.apache.lucene.index.IndexableField f) Convert the stored-field format to an external object.voidwrite(TextResponseWriter writer, String name, org.apache.lucene.index.IndexableField f) calls back to TextResponseWriter to write the field valueMethods inherited from class org.apache.solr.schema.FieldType
createField, enableDocValuesByDefault, getAnalyzerProperties, getClassArg, getDefaultMultiValueSelectorForSort, getDocValuesFormat, getExistenceQuery, getFieldQuery, getFieldTermQuery, getIndexAnalyzer, getNamedPropertyValues, getNonFieldPropertyArgs, getNumberType, getNumericSort, getPostingsFormat, getPrefixQuery, getQueryAnalyzer, getRangeQuery, getRewriteMethod, getSetQuery, getSimilarity, getSimilarityFactory, getSingleValueSource, getSortedNumericSortField, getSortedSetSortField, getSortField, getSpecializedExistenceQuery, getSpecializedRangeQuery, getStringSort, getTypeName, getValueSource, hasProperty, indexedToReadable, indexedToReadable, init, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPointField, isPolyField, isTokenized, isUtf8Field, marshalBase64SortValue, marshalSortValue, marshalStringSortValue, multiValuedFieldCache, readableToIndexed, readableToIndexed, restrictProps, setArgs, setIndexAnalyzer, setIsExplicitAnalyzer, setIsExplicitQueryAnalyzer, setQueryAnalyzer, setSimilarity, storedToIndexed, storedToReadable, supportsAnalyzers, toInternal, toObject, toString, treatUnboundedRangeAsExistence, unmarshalBase64SortValue, unmarshalSortValue, unmarshalStringSortValue, useDocValuesAsStored, write
-
Constructor Details
-
BinaryField
public BinaryField()
-
-
Method Details
-
checkSchemaField
Description copied from class:FieldTypeCheck'sSchemaFieldinstances constructed using this field type to ensure that they are valid.This method is called by the
SchemaFieldconstructor to check that its initialization does not violate any fundamental requirements of theFieldType. Subclasses may choose to throw aSolrExceptionif invariants are violated by theSchemaField.- Overrides:
checkSchemaFieldin classFieldType
-
write
public void write(TextResponseWriter writer, String name, org.apache.lucene.index.IndexableField f) throws IOException Description copied from class:FieldTypecalls back to TextResponseWriter to write the field valueSub-classes should prefer using
FieldType.toExternal(IndexableField)orFieldType.toObject(IndexableField)to get the writeable external value offinstead of directly usingf.stringValue()orf.binaryValue()- Specified by:
writein classFieldType- Throws:
IOException
-
getSortField
Description copied from class:FieldTypeReturns the SortField instance that should be used to sort fields of this type.- Specified by:
getSortFieldin classFieldType- See Also:
-
getUninversionType
Description copied from class:FieldTypeIf DocValues is not enabled for a field, but it's indexed, docvalues can be constructed on the fly (uninverted, aka fieldcache) on the first request to sort, facet, etc. This specifies the structure to use.This method will not be used if the field is (effectively)
uninvertible="false"- Specified by:
getUninversionTypein classFieldType- Parameters:
sf- field instance- Returns:
- type to uninvert, or
null(to disallow uninversion for the field) - See Also:
-
toExternal
Description copied from class:FieldTypeConvert the stored-field format to an external (string, human readable) value- Overrides:
toExternalin classFieldType- See Also:
-
toObject
Description copied from class:FieldTypeConvert the stored-field format to an external object. -
createField
Description copied from class:FieldTypeUsed for adding a document when a field needs to be created from a type and a string.By default, the indexed value is the same as the stored value (taken from toInternal()). Having a different representation for external, internal, and indexed would present quite a few problems given the current Lucene architecture. An analyzer for adding docs would need to translate internal->indexed while an analyzer for querying would need to translate external->indexed.
The only other alternative to having internal==indexed would be to have internal==external. In this case, toInternal should convert to the indexed representation, toExternal() should do nothing, and createField() should *not* call toInternal, but use the external value and set tokenized=true to get Lucene to convert to the internal(indexed) form. :TODO: clean up and clarify this explanation.
- Overrides:
createFieldin classFieldType- See Also:
-
createFields
Description copied from class:FieldTypeGiven aSchemaField, create one or moreIndexableFieldinstances- Overrides:
createFieldsin classFieldType- Parameters:
field- theSchemaFieldval- The value to add to the field- Returns:
- An array of
IndexableField - See Also:
-
checkSupportsDocValues
protected void checkSupportsDocValues()Description copied from class:FieldTypeCalled byFieldType.checkSchemaField(SchemaField)if the field has docValues. By default none do.- Overrides:
checkSupportsDocValuesin classFieldType
-
toNativeType
Description copied from class:FieldTypeConverts any Object to a java Object native to this field type- Overrides:
toNativeTypein classFieldType
-