public class ExternalFileField extends FieldType implements SchemaAware
keyField
will normally be the unique key field, but it doesn't have to be.
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, 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
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 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)
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.
|
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, checkSupportsDocValues, createField, createField, createFields, getAnalyzerProperties, getClassArg, getDefaultMultiValueSelectorForSort, getDocValuesFormat, getFieldQuery, getIndexAnalyzer, getNamedPropertyValues, getNonFieldPropertyArgs, getNumberType, getNumericSort, getPostingsFormat, getPrefixQuery, getQueryAnalyzer, getRangeQuery, getRewriteMethod, getSetQuery, getSimilarity, getSimilarityFactory, getSingleValueSource, getSortedNumericSortField, getSortedSetSortField, getSortField, getStringSort, getTypeName, hasProperty, indexedToReadable, indexedToReadable, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPointField, 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
public UninvertingReader.Type getUninversionType(SchemaField sf)
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"
getUninversionType
in class FieldType
sf
- field instancenull
(to disallow uninversion for the field)SchemaField.isUninvertible()
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-2018 Apache Software Foundation. All Rights Reserved.