public final class ManagedIndexSchema extends IndexSchema
| Modifier and Type | Class and Description | 
|---|---|
| static class  | ManagedIndexSchema.FieldExistsException | 
| static class  | ManagedIndexSchema.SchemaChangedInZkException | 
IndexSchema.DynamicCopy, IndexSchema.DynamicField, IndexSchema.DynamicReplacement, IndexSchema.SchemaPropsCOPY_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, MAX_CHARS, name, NAME, nameMapping, queryParserDefaultOperator, REQUIRED, requiredFields, resourceName, SCHEMA, schemaAware, similarity, SIMILARITY, similarityFactory, SLASH, SOLR_QUERY_PARSER, solrConfig, SOURCE, TYPE, TYPES, UNIQUE_KEY, uniqueKeyField, uniqueKeyFieldName, uniqueKeyFieldType, version, VERSION| Modifier and Type | Method and Description | 
|---|---|
| ManagedIndexSchema | addCopyFields(Map<String,Collection<String>> copyFields,
             boolean persist)Copies this schema and adds the new copy fields to the copy
 Requires synchronizing on the object returned by
  IndexSchema.getSchemaUpdateLock(). | 
| ManagedIndexSchema | addCopyFields(String source,
             Collection<String> destinations,
             int maxChars)Copies this schema and adds the new copy fields to the copy. | 
| ManagedIndexSchema | addDynamicFields(Collection<SchemaField> newDynamicFields,
                Map<String,Collection<String>> copyFieldNames,
                boolean persist)Copies this schema, adds the given dynamic fields to the copy,
 Requires synchronizing on the object returned by
  IndexSchema.getSchemaUpdateLock(). | 
| ManagedIndexSchema | addFields(Collection<SchemaField> newFields,
         Map<String,Collection<String>> copyFieldNames,
         boolean persist)Copies this schema, adds the given fields to the copy
 Requires synchronizing on the object returned by
  IndexSchema.getSchemaUpdateLock(). | 
| ManagedIndexSchema | addFieldTypes(List<FieldType> fieldTypeList,
             boolean persist)Copies this schema, adds the given field type to the copy,
 Requires synchronizing on the object returned by
  IndexSchema.getSchemaUpdateLock(). | 
| ManagedIndexSchema | deleteCopyFields(Map<String,Collection<String>> copyFields)Copies this schema and deletes the given copy fields from the copy. | 
| ManagedIndexSchema | deleteDynamicFields(Collection<String> fieldNamePatterns)Copies this schema, deletes the named dynamic fields from the copy. | 
| ManagedIndexSchema | deleteFields(Collection<String> names)Copies this schema, deletes the named fields from the copy. | 
| ManagedIndexSchema | deleteFieldTypes(Collection<String> names)Copies this schema, deletes the named field types from the copy. | 
| protected static List<String> | getActiveReplicaCoreUrls(ZkController zkController,
                        String collection,
                        String localCoreNodeName) | 
| Object | getSchemaUpdateLock()Returns the schema update lock that should be synchronized on
 to update the schema. | 
| int | getSchemaZkVersion() | 
| protected void | informResourceLoaderAwareObjectsForFieldType(FieldType fieldType)Informs analyzers used by a fieldType. | 
| protected void | informResourceLoaderAwareObjectsInChain(TokenizerChain chain)After creating a new FieldType, it may contain components that implement
 the ResourceLoaderAware interface, which need to be informed after they
 are loaded (as they depend on this callback to complete initialization work) | 
| boolean | isMutable() | 
| SchemaField | newDynamicField(String fieldNamePattern,
               String fieldType,
               Map<String,?> options)Returns a SchemaField if the given dynamic field glob does not already 
 exist in this schema, and does not match any dynamic fields 
 in this schema. | 
| 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. | 
| FieldType | newFieldType(String typeName,
            String className,
            Map<String,?> options)Returns a FieldType if the given typeName does not already
 exist in this schema. | 
| protected void | postReadInform() | 
| ManagedIndexSchema | replaceDynamicField(String fieldNamePattern,
                   FieldType replacementFieldType,
                   Map<String,?> replacementArgs)Copies this schema, deletes the named dynamic field from the copy, creates a new dynamic
 field with the same field name pattern using the given args, then rebinds any referring
 dynamic copy fields to the replacement dynamic field. | 
| ManagedIndexSchema | replaceField(String fieldName,
            FieldType replacementFieldType,
            Map<String,?> replacementArgs)Copies this schema, deletes the named field from the copy, creates a new field 
 with the same name using the given args, then rebinds any referring copy fields
 to the replacement field. | 
| ManagedIndexSchema | replaceFieldType(String typeName,
                String replacementClassName,
                Map<String,Object> replacementArgs)Copies this schema, deletes the named field type from the copy, creates a new field type 
 with the same name using the given args, rebuilds fields and dynamic fields of the given
 type, then rebinds any referring copy fields to the rebuilt fields. | 
| static void | waitForSchemaZkVersionAgreement(String collection,
                               String localCoreNodeName,
                               int schemaZkVersion,
                               ZkController zkController,
                               int maxWaitSecs)Block up to a specified maximum time until we see agreement on the schema
 version in ZooKeeper across all replicas for a collection. | 
addField, addField, addField, addFields, dynamicFieldListToSortedArray, getCopyFieldProperties, getCopyFieldsList, getCopyFieldsMap, getCopySources, getDefaultLuceneMatchVersion, getDefaultSearchFieldName, getDynamicCopyFields, getDynamicFieldPrototypes, getDynamicFields, getDynamicFieldType, getDynamicPattern, getField, getFieldOrNull, getFields, getFieldsWithDefaultValue, getFieldType, getFieldTypeByName, getFieldTypeNoEx, getFieldTypes, getFieldTypeXPathExpressions, getIndexAnalyzer, getNamedPropertyValues, getNamedPropertyValues, getQueryAnalyzer, getQueryParserDefaultOperator, getRequiredFields, getResourceLoader, getResourceName, getSchemaName, getSimilarity, getSimilarityFactory, getUninversionMap, getUniqueKeyField, getUniqueKeyField, getVersion, hasExplicitField, isCopyFieldTarget, isDuplicateDynField, isDynamicField, isValidDynamicField, isValidFieldGlob, loadCopyFields, loadFields, printableUniqueKey, readSchema, refreshAnalyzers, registerCopyField, registerCopyField, registerDynamicFields, registerExplicitSrcAndDestFields, setResourceNamepublic boolean isMutable()
isMutable in class IndexSchemapublic static void waitForSchemaZkVersionAgreement(String collection, String localCoreNodeName, int schemaZkVersion, ZkController zkController, int maxWaitSecs)
protected static List<String> getActiveReplicaCoreUrls(ZkController zkController, String collection, String localCoreNodeName)
public ManagedIndexSchema addFields(Collection<SchemaField> newFields, Map<String,Collection<String>> copyFieldNames, boolean persist)
IndexSchemaIndexSchema.getSchemaUpdateLock().addFields in class IndexSchemanewFields - the SchemaFields to addcopyFieldNames - 0 or more names of targets to copy this field to.  The target fields must already exist.persist - Persist the schema or notIndexSchema.newField(String, String, Map)public ManagedIndexSchema deleteFields(Collection<String> names)
IndexSchemaThe schema will not be persisted.
 Requires synchronizing on the object returned by
 IndexSchema.getSchemaUpdateLock().
deleteFields in class IndexSchemanames - the names of the fields to deletepublic ManagedIndexSchema replaceField(String fieldName, FieldType replacementFieldType, Map<String,?> replacementArgs)
IndexSchemaThe schema will not be persisted.
 Requires synchronizing on the object returned by IndexSchema.getSchemaUpdateLock().
replaceField in class IndexSchemafieldName - The name of the field to be replacedreplacementFieldType - The field type of the replacement fieldreplacementArgs - Initialization params for the replacement fieldpublic ManagedIndexSchema addDynamicFields(Collection<SchemaField> newDynamicFields, Map<String,Collection<String>> copyFieldNames, boolean persist)
IndexSchemaIndexSchema.getSchemaUpdateLock().addDynamicFields in class IndexSchemanewDynamicFields - the SchemaFields to addcopyFieldNames - 0 or more names of targets to copy this field to.  The target fields must already exist.persist - to persist the schema or notIndexSchema.newDynamicField(String, String, Map)public ManagedIndexSchema deleteDynamicFields(Collection<String> fieldNamePatterns)
IndexSchemaThe schema will not be persisted.
 Requires synchronizing on the object returned by
 IndexSchema.getSchemaUpdateLock().
deleteDynamicFields in class IndexSchemafieldNamePatterns - the names of the dynamic fields to deletepublic ManagedIndexSchema replaceDynamicField(String fieldNamePattern, FieldType replacementFieldType, Map<String,?> replacementArgs)
IndexSchemaThe schema will not be persisted.
 Requires synchronizing on the object returned by IndexSchema.getSchemaUpdateLock().
replaceDynamicField in class IndexSchemafieldNamePattern - The glob for the dynamic field to be replacedreplacementFieldType - The field type of the replacement dynamic fieldreplacementArgs - Initialization params for the replacement dynamic fieldpublic ManagedIndexSchema addCopyFields(Map<String,Collection<String>> copyFields, boolean persist)
IndexSchemaIndexSchema.getSchemaUpdateLock().addCopyFields in class IndexSchemacopyFields - Key is the name of the source field name, value is a collection of target field names.  Fields must exist.persist - to persist the schema or notto limit the number of copied characters.public ManagedIndexSchema addCopyFields(String source, Collection<String> destinations, int maxChars)
IndexSchemaIndexSchema.getSchemaUpdateLock()addCopyFields in class IndexSchemasource - source field namedestinations - collection of target field namesmaxChars - max number of characters to copy from the source to each
                 of the destinations.  Use CopyField.UNLIMITED
                 if you don't want to limit the number of copied chars.public ManagedIndexSchema deleteCopyFields(Map<String,Collection<String>> copyFields)
IndexSchemaThe schema will not be persisted.
 Requires synchronizing on the object returned by
 IndexSchema.getSchemaUpdateLock().
deleteCopyFields in class IndexSchemacopyFields - Key is the name of the source field name, value is a collection of target field names. 
                   Each corresponding copy field directives must exist.public ManagedIndexSchema addFieldTypes(List<FieldType> fieldTypeList, boolean persist)
IndexSchemaIndexSchema.getSchemaUpdateLock().addFieldTypes in class IndexSchemafieldTypeList - a list of FieldTypes to addpersist - to persist the schema or notIndexSchema.newFieldType(String, String, Map)public ManagedIndexSchema deleteFieldTypes(Collection<String> names)
IndexSchemaThe schema will not be persisted.
 Requires synchronizing on the object returned by IndexSchema.getSchemaUpdateLock().
deleteFieldTypes in class IndexSchemanames - the names of the field types to deletepublic ManagedIndexSchema replaceFieldType(String typeName, String replacementClassName, Map<String,Object> replacementArgs)
IndexSchemaThe schema will not be persisted.
 Requires synchronizing on the object returned by IndexSchema.getSchemaUpdateLock().
replaceFieldType in class IndexSchematypeName - The name of the field type to be replacedreplacementClassName - The class name of the replacement field typereplacementArgs - Initialization params for the replacement field typeprotected void postReadInform()
postReadInform in class IndexSchemaprotected void informResourceLoaderAwareObjectsForFieldType(FieldType fieldType)
public SchemaField newField(String fieldName, String fieldType, Map<String,?> options)
IndexSchemaIndexSchema.addField(SchemaField).newField in class IndexSchemafieldName - the name of the field to addfieldType - the field type for the new fieldoptions - the options to use when creating the SchemaFieldIndexSchema.addField(SchemaField)public int getSchemaZkVersion()
public SchemaField newDynamicField(String fieldNamePattern, String fieldType, Map<String,?> options)
IndexSchemaIndexSchema.addField(SchemaField).newDynamicField in class IndexSchemafieldNamePattern - the pattern for the dynamic field to addfieldType - the field type for the new fieldoptions - the options to use when creating the SchemaFieldIndexSchema.addField(SchemaField)public FieldType newFieldType(String typeName, String className, Map<String,?> options)
IndexSchemaIndexSchema.addFieldTypes(java.util.List, boolean).newFieldType in class IndexSchematypeName - the name of the type to addclassName - the name of the FieldType classoptions - the options to use when creating the FieldTypeIndexSchema.addFieldTypes(java.util.List, boolean)protected void informResourceLoaderAwareObjectsInChain(TokenizerChain chain)
public Object getSchemaUpdateLock()
IndexSchemagetSchemaUpdateLock in class IndexSchemaCopyright © 2000-2017 Apache Software Foundation. All Rights Reserved.