org.apache.solr.schema
Class ManagedIndexSchema

java.lang.Object
  extended by org.apache.solr.schema.IndexSchema
      extended by org.apache.solr.schema.ManagedIndexSchema

public final class ManagedIndexSchema
extends IndexSchema

Solr-managed schema - non-user-editable, but can be mutable via internal and external REST API requests.


Nested Class Summary
 class ManagedIndexSchema.FieldExistsException
           
 
Nested classes/interfaces inherited from class org.apache.solr.schema.IndexSchema
IndexSchema.DynamicCopy, IndexSchema.DynamicField, IndexSchema.DynamicReplacement
 
Field Summary
 
Fields inherited from class org.apache.solr.schema.IndexSchema
COPY_FIELD, COPY_FIELDS, copyFieldsMap, copyFieldTargetCounts, DEFAULT_OPERATOR, DEFAULT_SCHEMA_FILE, DEFAULT_SEARCH_FIELD, defaultSearchFieldName, DESTINATION, DYNAMIC_FIELD, DYNAMIC_FIELDS, dynamicCopyFields, dynamicFields, FIELD, FIELD_TYPE, FIELD_TYPES, fields, FIELDS, fieldsWithDefaultValue, fieldTypes, INTERNAL_POLY_FIELD_PREFIX, isExplicitQueryParserDefaultOperator, isExplicitSimilarity, loader, LUCENE_MATCH_VERSION_PARAM, name, NAME, queryParserDefaultOperator, REQUIRED, requiredFields, resourceName, SCHEMA, schemaAware, similarity, SIMILARITY, similarityFactory, SLASH, SOLR_QUERY_PARSER, solrConfig, SOURCE, TYPE, TYPES, UNIQUE_KEY, uniqueKeyField, uniqueKeyFieldName, uniqueKeyFieldType, version, VERSION
 
Method Summary
 ManagedIndexSchema addCopyFields(Map<String,Collection<String>> copyFields)
          Copies this schema and adds the new copy fields to the copy, then persists the new schema
 ManagedIndexSchema addField(SchemaField newField)
          Copies this schema, adds the given field to the copy, then persists the new schema.
 ManagedIndexSchema addField(SchemaField newField, Collection<String> copyFieldNames)
          Copies this schema, adds the given field to the copy, then persists the new schema.
 ManagedIndexSchema addFields(Collection<SchemaField> newFields)
          Copies this schema, adds the given fields to the copy, then persists the new schema.
 ManagedIndexSchema addFields(Collection<SchemaField> newFields, Map<String,Collection<String>> copyFieldNames)
          Copies this schema, adds the given fields to the copy, then persists the new schema.
 Object getSchemaUpdateLock()
           
 boolean isMutable()
           
 SchemaField newField(String fieldName, String fieldType, Map<String,?> options)
          Returns a SchemaField if the given fieldName does not already exist in this schema, and does not match any dynamic fields in this schema.
 
Methods inherited from class org.apache.solr.schema.IndexSchema
getAnalyzer, getCopyFieldProperties, getCopyFieldsList, getCopyFieldsMap, getCopySources, getDefaultLuceneMatchVersion, getDefaultSearchFieldName, getDynamicCopyFields, getDynamicFieldPrototypes, getDynamicFields, getDynamicFieldType, getDynamicPattern, getField, getFieldOrNull, getFields, getFieldsWithDefaultValue, getFieldType, getFieldTypeByName, getFieldTypeNoEx, getFieldTypes, getNamedPropertyValues, getQueryAnalyzer, getQueryParserDefaultOperator, getRequiredFields, getResourceLoader, getResourceName, getSchemaName, getSimilarity, getSimilarityFactory, getUniqueKeyField, getUniqueKeyField, getVersion, hasExplicitField, isCopyFieldTarget, isDynamicField, loadFields, printableUniqueKey, readSchema, refreshAnalyzers, registerCopyField, registerCopyField, registerDynamicFields, setResourceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isMutable

public boolean isMutable()
Overrides:
isMutable in class IndexSchema

addField

public ManagedIndexSchema addField(SchemaField newField)
Description copied from class: IndexSchema
Copies this schema, adds the given field to the copy, then persists the new schema.

Overrides:
addField in class IndexSchema
Parameters:
newField - the SchemaField to add
Returns:
a new IndexSchema based on this schema with newField added
See Also:
IndexSchema.newField(String, String, Map)

addField

public ManagedIndexSchema addField(SchemaField newField,
                                   Collection<String> copyFieldNames)
Description copied from class: IndexSchema
Copies this schema, adds the given field to the copy, then persists the new schema.

Overrides:
addField in class IndexSchema
Parameters:
newField - the SchemaField to add
copyFieldNames - 0 or more names of targets to copy this field to. The targets must already exist.
Returns:
a new IndexSchema based on this schema with newField added
See Also:
IndexSchema.newField(String, String, Map)

addFields

public ManagedIndexSchema addFields(Collection<SchemaField> newFields)
Description copied from class: IndexSchema
Copies this schema, adds the given fields to the copy, then persists the new schema.

Overrides:
addFields in class IndexSchema
Parameters:
newFields - the SchemaFields to add
Returns:
a new IndexSchema based on this schema with newFields added
See Also:
IndexSchema.newField(String, String, Map)

addFields

public ManagedIndexSchema addFields(Collection<SchemaField> newFields,
                                    Map<String,Collection<String>> copyFieldNames)
Description copied from class: IndexSchema
Copies this schema, adds the given fields to the copy, then persists the new schema.

Overrides:
addFields in class IndexSchema
Parameters:
newFields - the SchemaFields to add
copyFieldNames - 0 or more names of targets to copy this field to. The target fields must already exist.
Returns:
a new IndexSchema based on this schema with newFields added
See Also:
IndexSchema.newField(String, String, Map)

addCopyFields

public ManagedIndexSchema addCopyFields(Map<String,Collection<String>> copyFields)
Description copied from class: IndexSchema
Copies this schema and adds the new copy fields to the copy, then persists the new schema

Overrides:
addCopyFields in class IndexSchema
Parameters:
copyFields - Key is the name of the source field name, value is a collection of target field names. Fields must exist.
Returns:
The new Schema with the copy fields added

newField

public SchemaField newField(String fieldName,
                            String fieldType,
                            Map<String,?> options)
Description copied from class: IndexSchema
Returns a SchemaField if the given fieldName does not already exist in this schema, and does not match any dynamic fields in this schema. The resulting SchemaField can be used in a call to IndexSchema.addField(SchemaField).

Overrides:
newField in class IndexSchema
Parameters:
fieldName - the name of the field to add
fieldType - the field type for the new field
options - the options to use when creating the SchemaField
Returns:
The created SchemaField
See Also:
IndexSchema.addField(SchemaField)

getSchemaUpdateLock

public Object getSchemaUpdateLock()


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.