Michael Hu
2018-12-07 00:27:55 UTC
Environment: Solr 7.4
I use mutable managed schema. I need a way for getting notification when a new field is added into schema.
First, I try to extend "org.apache.solr.schema.ManagedIndexSchema". Unfortunately, it is defined as final class, so that I am not able to extend it.
Then, I try to implement my own IndexSchemaFactory and IndexSchema by extending "org.apache.solr.schema.IndexSchema" and wrapping an instance of ManagedIndexSchema, and delegating all methods to the wrapped instance. However, when I test the implementation, I find out that "com.vmware.ops.data.solr.processor.AddSchemaFieldsUpdateProcessor" casts IndexSchema to ManagedIndexSchema at https://github.com/apache/lucene-solr/blob/releases/lucene-solr/7.4.0/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java#L456 . So it does not work with the update processor. (NOTE: the cast happens for Solr 7.5 as well)
Can you suggest a way so that I can get notification when a new field is added into schema.?
Thank you for your help!
--Michael
I use mutable managed schema. I need a way for getting notification when a new field is added into schema.
First, I try to extend "org.apache.solr.schema.ManagedIndexSchema". Unfortunately, it is defined as final class, so that I am not able to extend it.
Then, I try to implement my own IndexSchemaFactory and IndexSchema by extending "org.apache.solr.schema.IndexSchema" and wrapping an instance of ManagedIndexSchema, and delegating all methods to the wrapped instance. However, when I test the implementation, I find out that "com.vmware.ops.data.solr.processor.AddSchemaFieldsUpdateProcessor" casts IndexSchema to ManagedIndexSchema at https://github.com/apache/lucene-solr/blob/releases/lucene-solr/7.4.0/solr/core/src/java/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.java#L456 . So it does not work with the update processor. (NOTE: the cast happens for Solr 7.5 as well)
Can you suggest a way so that I can get notification when a new field is added into schema.?
Thank you for your help!
--Michael