Package org.apache.solr.handler.designer
Class DefaultSchemaSuggester
- java.lang.Object
-
- org.apache.solr.handler.designer.DefaultSchemaSuggester
-
- All Implemented Interfaces:
SchemaSuggester
,NamedListInitializedPlugin
public class DefaultSchemaSuggester extends Object implements SchemaSuggester
-
-
Constructor Summary
Constructors Constructor Description DefaultSchemaSuggester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManagedIndexSchema
adaptExistingFieldToData(SchemaField schemaField, List<Object> sampleValues, ManagedIndexSchema schema)
protected Map<String,String>
guessFieldProps(String fieldName, FieldType fieldType, List<Object> sampleValues, boolean isMV, IndexSchema schema)
protected String
guessFieldType(String fieldName, List<Object> sampleValues, IndexSchema schema, boolean isMV, Locale locale)
void
init(org.apache.solr.common.util.NamedList<?> args)
init
will be called just once, immediately after creation.protected void
initBooleanParsing(org.apache.solr.common.util.NamedList<?> args)
protected void
initDateTimeFormatters(org.apache.solr.common.util.NamedList<?> args)
protected boolean
isBoolean(List<Object> values)
protected boolean
isDateTime(List<Object> values)
protected String
isFloatOrDouble(List<Object> values, Locale locale)
protected String
isIntOrLong(List<Object> values, Locale locale)
boolean
isMultiValued(String name, List<org.apache.solr.common.SolrInputDocument> docs)
protected boolean
isMultiValued(List<Object> sampleValues)
protected boolean
isText(List<Object> values)
Optional<SchemaField>
suggestField(String fieldName, List<Object> sampleValues, IndexSchema schema, List<String> langs)
Map<String,List<Object>>
transposeDocs(List<org.apache.solr.common.SolrInputDocument> docs)
protected void
validateNumericTypeChange(SchemaField field, FieldType toType, List<org.apache.solr.common.SolrInputDocument> docs, NumberType toNumType)
void
validateTypeChange(SchemaField field, FieldType toType, List<org.apache.solr.common.SolrInputDocument> docs)
-
-
-
Method Detail
-
validateTypeChange
public void validateTypeChange(SchemaField field, FieldType toType, List<org.apache.solr.common.SolrInputDocument> docs) throws IOException
- Specified by:
validateTypeChange
in interfaceSchemaSuggester
- Throws:
IOException
-
validateNumericTypeChange
protected void validateNumericTypeChange(SchemaField field, FieldType toType, List<org.apache.solr.common.SolrInputDocument> docs, NumberType toNumType)
-
suggestField
public Optional<SchemaField> suggestField(String fieldName, List<Object> sampleValues, IndexSchema schema, List<String> langs)
- Specified by:
suggestField
in interfaceSchemaSuggester
-
adaptExistingFieldToData
public ManagedIndexSchema adaptExistingFieldToData(SchemaField schemaField, List<Object> sampleValues, ManagedIndexSchema schema)
- Specified by:
adaptExistingFieldToData
in interfaceSchemaSuggester
-
transposeDocs
public Map<String,List<Object>> transposeDocs(List<org.apache.solr.common.SolrInputDocument> docs)
- Specified by:
transposeDocs
in interfaceSchemaSuggester
-
guessFieldType
protected String guessFieldType(String fieldName, List<Object> sampleValues, IndexSchema schema, boolean isMV, Locale locale)
-
isMultiValued
public boolean isMultiValued(String name, List<org.apache.solr.common.SolrInputDocument> docs)
- Specified by:
isMultiValued
in interfaceSchemaSuggester
-
guessFieldProps
protected Map<String,String> guessFieldProps(String fieldName, FieldType fieldType, List<Object> sampleValues, boolean isMV, IndexSchema schema)
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
Description copied from interface:NamedListInitializedPlugin
init
will be called just once, immediately after creation.Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself
- Specified by:
init
in interfaceNamedListInitializedPlugin
- Parameters:
args
- non-null list of initialization parameters (may be empty)
-
initDateTimeFormatters
protected void initDateTimeFormatters(org.apache.solr.common.util.NamedList<?> args)
-
initBooleanParsing
protected void initBooleanParsing(org.apache.solr.common.util.NamedList<?> args)
-
-