FUSION— Change Schema Settings from Managed Type to Classic Schema Factory

What is Managed Schema?
Please go through the following article: https://support.lucidworks.com/hc/en-us/articles/221618187

 

General steps to change the schema settings from managed-type to Classic schema type

Make the below curl request. The Curl request can be made via command line or POSTMAN. 

This curl command will do the following 

* managed-schema -> schema.xml rename
* XML dom manipulations for 
<ManagedIndexSchemaFactory> -> <ClassicIndexSchemaFactory>
* And reloads Solr collection
* Modifies fusion UI's config section, providing edit interface for configs.

Via Curl :

curl -u admin:pass -X PUT -H 'Content-type: application/json' 'http://localhost:8764/api/apollo/collections/<collection_name>/features/dynamicSchema' -d '{"enabled": false}'

Via POSTMAN :

If you are new to POSTMAN, please checkout "getting started article"

Otherwise, just go ahead, import the attached json to POSTMAN and modify the <collection name> as per your collection name and send the request. If the request is success, the response tab will have "No response received".  Attached screenshot of postman reference.


Specific to FUSION 2.4.1- Convert the schemaless mode to classic schema mode.


Please find the steps below along with the screenshots:

1. You can check if you current mode is schemaless or classic schema by going to Collection --> Configuration --> Solar Config. Here you will see a file managed-schema if it is not in Classic Schema mode (Screenshot attached).
2. Now execute the following curl command from the command line (screenshot attached)

Syntax:
-------------

$ curl -u username:password -X PUT -H 'Content-type: application/json' 'http://localhost:8764/api/apollo/collections/<collection_name>/features/dynamicSchema' -d '{"enabled": false}'

Example:
--------------
curl -u admin:root12345 -X PUT -H 'Content-type: application/json' 'http://localhost:8764/api/apollo/collections/testcollection2/features/dynamicSchema' -d '{"enabled": false}'

3. Goto Collection --> Configuration --> Solr Config. Here, you will see schema.xml (Screenshot attached).

Please follow the above steps. Hope this solves your problem. Let me know if you need any help with the steps.

 

Possible Error messages!

Depending on the details of your solrconfig.xml file, turning dynamicSchema off in Fusion, may cause the following type of error in subsequent crawls, which will prevent documents from being stored:

Error from server at http://192.168.200.25:8983/solr/ClassicSchema_shard1_replica1: This IndexSchema is not mutable.

This may be caused by numerous things, but the most likely is that there is a processor using "AddSchemaFieldsUpdateProcessorFactory".  Do a find for that in your solrconfig.xml, and then comment it out:

    <!-- This processor require dynamicSchema to be enabled
    <processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
      <str name="defaultFieldType">strings</str>
      <lst name="typeMapping">
        <str name="valueClass">java.lang.Boolean</str>
        <str name="fieldType">booleans</str>
      </lst>
      <lst name="typeMapping">
        <str name="valueClass">java.util.Date</str>
        <str name="fieldType">tdates</str>
      </lst>
      <lst name="typeMapping">
        <str name="valueClass">java.lang.Long</str>
        <str name="valueClass">java.lang.Integer</str>
        <str name="fieldType">tlongs</str>
      </lst>
      <lst name="typeMapping">
        <str name="valueClass">java.lang.Number</str>
        <str name="fieldType">tdoubles</str>
      </lst>
    </processor>
    -->

 

Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Ibrahim Bakayoko

     

    curl -u user:pass -X PUT -H Content-type:application/json -d '{"enabled":false}' http://localhost:8764/api/apollo/collections/<collectionId>/features/dynamicSchema

    works on 2.4

    Edited by Ibrahim Bakayoko
  • 0
    Avatar
    Rajani Maski

    Hi Ibrahim,

    Article is updated for fusion 2.4.1

Please sign in to leave a comment.
Powered by Zendesk