Package org.apache.solr.handler.designer
Class ManagedSchemaDiff
- java.lang.Object
-
- org.apache.solr.handler.designer.ManagedSchemaDiff
-
public class ManagedSchemaDiff extends Object
Utility methods for comparing managed index schemas
-
-
Constructor Summary
Constructors Constructor Description ManagedSchemaDiff()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static Map<String,Object>
diff(List<org.apache.solr.common.util.SimpleOrderedMap<Object>> list1, List<org.apache.solr.common.util.SimpleOrderedMap<Object>> list2)
protected static Map<String,Object>
diff(Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>> map1, Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>> map2)
Compute difference between two map objects withSimpleOrderedMap
as values.static Map<String,Object>
diff(ManagedIndexSchema oldSchema, ManagedIndexSchema newSchema)
Compute difference between two managed schemas.protected static List<org.apache.solr.common.util.SimpleOrderedMap<Object>>
getCopyFieldList(ManagedIndexSchema indexSchema)
protected static Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>>
mapDynamicFieldToPropValues(IndexSchema.DynamicField[] dynamicFields)
protected static Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>>
mapFieldsToPropertyValues(Map<String,SchemaField> fields)
protected static Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>>
mapFieldTypesToPropValues(Map<String,FieldType> fieldTypes)
-
-
-
Method Detail
-
diff
public static Map<String,Object> diff(ManagedIndexSchema oldSchema, ManagedIndexSchema newSchema)
Compute difference between two managed schemas. The returned map consists of changed, new, removed elements in fields, field types, dynamic fields and copy fields between input schemas.Output format when rendered to json will look like below:
{ "fields": { "updated": {...}, "added": {...}, "removed": {...} }, "fieldTypes": { "updated": {...}, "added": {...}, "removed": {...} }, "dynamicFields": { "updated": {...}, "added": {...}, "removed": {...} }, "copyFields: { "new": [...], "old": [...] } }
- Parameters:
oldSchema
- instance ofManagedIndexSchema
newSchema
- instance ofManagedIndexSchema
- Returns:
- the difference between two schemas
-
diff
protected static Map<String,Object> diff(Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>> map1, Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>> map2)
Compute difference between two map objects withSimpleOrderedMap
as values.Example of the output format when rendered to json
{ "updated": { "stringField": [ { "docValues": "false" }, { "docValues": "true" } }, "added": { "newstringfield: { "name": "newstringfield", "type": "string", ..... } }, "removed": { "oldstringfield": { "name": "oldstringfield", "type": "string", ..... } } }
- Parameters:
map1
- instance of Map withSimpleOrderedMap
elementsmap2
- instance of Map withSimpleOrderedMap
elements- Returns:
- the difference between two Map
-
diff
protected static Map<String,Object> diff(List<org.apache.solr.common.util.SimpleOrderedMap<Object>> list1, List<org.apache.solr.common.util.SimpleOrderedMap<Object>> list2)
-
mapFieldsToPropertyValues
protected static Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>> mapFieldsToPropertyValues(Map<String,SchemaField> fields)
-
mapFieldTypesToPropValues
protected static Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>> mapFieldTypesToPropValues(Map<String,FieldType> fieldTypes)
-
mapDynamicFieldToPropValues
protected static Map<String,org.apache.solr.common.util.SimpleOrderedMap<Object>> mapDynamicFieldToPropValues(IndexSchema.DynamicField[] dynamicFields)
-
getCopyFieldList
protected static List<org.apache.solr.common.util.SimpleOrderedMap<Object>> getCopyFieldList(ManagedIndexSchema indexSchema)
-
-