Class BinaryField
- java.lang.Object
-
- org.apache.solr.schema.FieldProperties
-
- org.apache.solr.schema.FieldType
-
- org.apache.solr.schema.BinaryField
-
public class BinaryField extends FieldType
-
-
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, typeName
-
Fields 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 Constructor Description BinaryField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkSchemaField(SchemaField field)
Check'sSchemaField
instances constructed using this field type to ensure that they are valid.org.apache.lucene.index.IndexableField
createField(SchemaField field, Object val)
Used for adding a document when a field needs to be created from a type and a string.org.apache.lucene.search.SortField
getSortField(SchemaField field, boolean top)
Returns the SortField instance that should be used to sort fields of this type.UninvertingReader.Type
getUninversionType(SchemaField sf)
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.String
toExternal(org.apache.lucene.index.IndexableField f)
Convert the stored-field format to an external (string, human readable) valueObject
toNativeType(Object val)
Converts any Object to a java Object native to this field typeByteBuffer
toObject(org.apache.lucene.index.IndexableField f)
Convert the stored-field format to an external object.void
write(TextResponseWriter writer, String name, org.apache.lucene.index.IndexableField f)
calls back to TextResponseWriter to write the field value-
Methods inherited from class org.apache.solr.schema.FieldType
checkSupportsDocValues, createField, createFields, 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
-
-
-
-
Method Detail
-
checkSchemaField
public void checkSchemaField(SchemaField field)
Description copied from class:FieldType
Check'sSchemaField
instances constructed using this field type to ensure that they are valid.This method is called by the
SchemaField
constructor to check that its initialization does not violate any fundamental requirements of theFieldType
. Subclasses may choose to throw aSolrException
if invariants are violated by theSchemaField.
- Overrides:
checkSchemaField
in classFieldType
-
write
public void write(TextResponseWriter writer, String name, org.apache.lucene.index.IndexableField f) throws IOException
Description copied from class:FieldType
calls back to TextResponseWriter to write the field valueSub-classes should prefer using
FieldType.toExternal(IndexableField)
orFieldType.toObject(IndexableField)
to get the writeable external value off
instead of directly usingf.stringValue()
orf.binaryValue()
- Specified by:
write
in classFieldType
- Throws:
IOException
-
getSortField
public org.apache.lucene.search.SortField getSortField(SchemaField field, boolean top)
Description copied from class:FieldType
Returns the SortField instance that should be used to sort fields of this type.
-
getUninversionType
public UninvertingReader.Type getUninversionType(SchemaField sf)
Description copied from class:FieldType
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. This specifies the structure to use.This method will not be used if the field is (effectively)
uninvertible="false"
- Specified by:
getUninversionType
in classFieldType
- Parameters:
sf
- field instance- Returns:
- type to uninvert, or
null
(to disallow uninversion for the field) - See Also:
SchemaField.isUninvertible()
-
toExternal
public String toExternal(org.apache.lucene.index.IndexableField f)
Description copied from class:FieldType
Convert the stored-field format to an external (string, human readable) value- Overrides:
toExternal
in classFieldType
- See Also:
FieldType.toInternal(java.lang.String)
-
toObject
public ByteBuffer toObject(org.apache.lucene.index.IndexableField f)
Description copied from class:FieldType
Convert the stored-field format to an external object.- Overrides:
toObject
in classFieldType
- See Also:
FieldType.toInternal(java.lang.String)
-
createField
public org.apache.lucene.index.IndexableField createField(SchemaField field, Object val)
Description copied from class:FieldType
Used 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:
createField
in classFieldType
- See Also:
FieldType.toInternal(java.lang.String)
-
toNativeType
public Object toNativeType(Object val)
Description copied from class:FieldType
Converts any Object to a java Object native to this field type- Overrides:
toNativeType
in classFieldType
-
-