public class ExternalFileField extends FieldType implements SchemaAware
keyField
will normally be the unique key field, but it doesn't have to be.
valType
is a reference to another fieldType to define the value type of this field
(must currently be TrieFloatField or LegacyFloatField (valType="pfloat|float|tfloat") if used).
This parameter has never been implemented. As of Solr 3.6/4.0 it is optional and can be omitted.
The format of the external file is simply newline separated keyFieldValue=floatValue.
doc33=1.414
doc34=3.14159
doc40=42
Solr looks for the external file in the index directory under the name of external_<fieldname> or external_<fieldname>.*
If any files of the latter pattern appear, the last (after being sorted by name) will be used and previous versions will be deleted. This is to help support systems where one may not be able to overwrite a file (like Windows, if the file is in use).
If the external file has already been loaded, and it is changed, those changes will not be visible until a commit has been done.
The external file may be sorted or unsorted by the key field, but it will be substantially slower (untested) if it isn't sorted.
Fields of this type may currently only be used as a ValueSource in a FunctionQuery.
ExternalFileFieldReloader
FieldType.DefaultAnalyzer, FieldType.MultiValueSelector
ANALYZER, args, CHAR_FILTER, CHAR_FILTERS, CLASS_NAME, docValuesFormat, falseProperties, FILTER, FILTERS, INDEX, INDEX_ANALYZER, MULTI_TERM, MULTI_TERM_ANALYZER, POLY_FIELD_SEPARATOR, postingsFormat, properties, QUERY, QUERY_ANALYZER, similarity, SIMILARITY, similarityFactory, TOKENIZER, trueProperties, TYPE, TYPE_NAME, typeName
BINARY, DOC_VALUES, INDEXED, 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, USE_DOCVALUES_AS_STORED
Constructor and Description |
---|
ExternalFileField() |
Modifier and Type | Method and Description |
---|---|
FileFloatSource |
getFileFloatSource(SchemaField field)
Get a FileFloatSource for the given field, using the datadir from the
IndexSchema
|
FileFloatSource |
getFileFloatSource(SchemaField field,
String datadir)
Get a FileFloatSource for the given field.
|
SortField |
getSortField(SchemaField field,
boolean reverse)
Returns the SortField instance that should be used to sort fields
of this type.
|
UninvertingReader.Type |
getUninversionType(SchemaField sf)
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.
|
ValueSource |
getValueSource(SchemaField field,
QParser parser)
called to get the default value source (normally, from the
Lucene FieldCache.)
|
void |
inform(IndexSchema schema)
Informs the
IndexSchema provided by the schema
parameter of an event (e.g., a new FieldType was added, etc. |
protected void |
init(IndexSchema schema,
Map<String,String> args)
subclasses should initialize themselves with the args provided
and remove valid arguments.
|
void |
write(TextResponseWriter writer,
String name,
IndexableField f)
calls back to TextResponseWriter to write the field value
|
checkSchemaField, createField, createField, createFields, getAnalyzerProperties, getClassArg, getDocValuesFormat, getFieldQuery, getIndexAnalyzer, getIndexOptions, getNamedPropertyValues, getNonFieldPropertyArgs, getNumericType, getPostingsFormat, getPrefixQuery, getQueryAnalyzer, getRangeQuery, getRewriteMethod, getSimilarity, getSimilarityFactory, getSingleValueSource, getStringSort, getTypeName, hasProperty, indexedToReadable, indexedToReadable, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPolyField, isTokenized, marshalBase64SortValue, marshalSortValue, marshalStringSortValue, multiValuedFieldCache, readableToIndexed, readableToIndexed, restrictProps, setArgs, setIndexAnalyzer, setIsExplicitAnalyzer, setIsExplicitQueryAnalyzer, setQueryAnalyzer, setSimilarity, storedToIndexed, storedToReadable, supportsAnalyzers, toExternal, toInternal, toNativeType, toObject, toObject, toString, unmarshalBase64SortValue, unmarshalSortValue, unmarshalStringSortValue, useDocValuesAsStored
protected void init(IndexSchema schema, Map<String,String> args)
FieldType
public void write(TextResponseWriter writer, String name, IndexableField f) throws IOException
FieldType
write
in class FieldType
IOException
public SortField getSortField(SchemaField field, boolean reverse)
FieldType
getSortField
in class FieldType
SchemaField.checkSortability()
public UninvertingReader.Type getUninversionType(SchemaField sf)
FieldType
getUninversionType
in class FieldType
sf
- field instancenull
(to disallow uninversion for the field)public ValueSource getValueSource(SchemaField field, QParser parser)
FieldType
getValueSource
in class FieldType
public FileFloatSource getFileFloatSource(SchemaField field)
field
- the field to get a source forpublic FileFloatSource getFileFloatSource(SchemaField field, String datadir)
field
- the field to get a source fordatadir
- the data directory in which to look for the external filepublic void inform(IndexSchema schema)
SchemaAware
IndexSchema
provided by the schema
parameter of an event (e.g., a new FieldType
was added, etc.inform
in interface SchemaAware
schema
- The IndexSchema
instance that inform of the update to.Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.