You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by TK Solr <tk...@sonic.net> on 2020/04/06 18:10:43 UTC

Proper way to manage managed-schema file

I am using Solr 8.3.1 in non-SolrCloud mode (what should I call this mode?) and 
modifying managed-schema.

I noticed that Solr does override this file wiping out all my comments and 
rearranging the order. I noticed there is a "DO NOT EDIT" comment. Then, what is 
the proper/expected way to manage this file? Admin UI can add fields but cannot 
edit existing one or add new field types. Do I keep a script of many schema 
calls? (Then how do I reset the default to the initial one, which would be 
needed before re-re-playing the schema calls.)

TK



Re: Proper way to manage managed-schema file

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
If you are using API (which AdminUI does), the regenerated file will
loose comments and sort everything in particular order. That's just
the implementation at the moment.

If you don't like that, you can always modify the schema file by hand
and reload the core to notice the changes. You can even set the schema
to be immutable to avoid accidentally doing it.

The other option is not to have the comments in that file and then,
after first rewrite, the others are quite incremental and make it easy
to track the changes.

Regards,
   Alex.

On Mon, 6 Apr 2020 at 14:11, TK Solr <tk...@sonic.net> wrote:
>
> I am using Solr 8.3.1 in non-SolrCloud mode (what should I call this mode?) and
> modifying managed-schema.
>
> I noticed that Solr does override this file wiping out all my comments and
> rearranging the order. I noticed there is a "DO NOT EDIT" comment. Then, what is
> the proper/expected way to manage this file? Admin UI can add fields but cannot
> edit existing one or add new field types. Do I keep a script of many schema
> calls? (Then how do I reset the default to the initial one, which would be
> needed before re-re-playing the schema calls.)
>
> TK
>
>

Re: Proper way to manage managed-schema file

Posted by Jörn Franke <jo...@gmail.com>.
You can use the Solr rest services to do all those operations. 

https://lucene.apache.org/solr/guide/8_3/schema-api.html

Normally in a productive environment you don’t use the UI but do all changes in a controlled automated fashion using the REST APIs.



> Am 06.04.2020 um 20:11 schrieb TK Solr <tk...@sonic.net>:
> 
> I am using Solr 8.3.1 in non-SolrCloud mode (what should I call this mode?) and modifying managed-schema.
> 
> I noticed that Solr does override this file wiping out all my comments and rearranging the order. I noticed there is a "DO NOT EDIT" comment. Then, what is the proper/expected way to manage this file? Admin UI can add fields but cannot edit existing one or add new field types. Do I keep a script of many schema calls? (Then how do I reset the default to the initial one, which would be needed before re-re-playing the schema calls.)
> 
> TK
> 
>