Thanks for the replies. The problem I'm trying to solve is to automate whatever steps I can in configuring Solr for our customer. Rather than an admin have to edit schema.xml, I thought it would be easier and less error-prone to do it programmatically. But I'm a novice, so if there is a better, more standard way, please let me know. Thanks!!!
PS: What do you mean by "XY problem"? On Thu, Jan 7, 2016 at 11:20 PM, Erick Erickson <erickerick...@gmail.com> wrote: > I'd ask first what the high-level problem you're trying to solve is, this > could be an XY problem. > > That said, there's the Schema API you can use, see: > https://cwiki.apache.org/confluence/display/solr/Schema+API > > You can access it from the SolrJ library, see > SchemaRequest.java. For examples of using this, see: > SchemaTest.java > > to _get_ the Solr source code to see these, see: > https://wiki.apache.org/solr/HowToContribute > > Best, > Erick > > On Thu, Jan 7, 2016 at 7:01 PM, Binoy Dalal <binoydala...@gmail.com> > wrote: > > I am not sure about solrj but you can use any XML parsing library to > > achieve this. > > Take a look here: > > http://www.tutorialspoint.com/java_xml/java_xml_parsers.htm > > > > On Fri, 8 Jan 2016, 08:06 Bob Lawson <bwlawson...@gmail.com> wrote: > > > >> I want to programmatically make changes to schema.xml using java to do > >> it. Should I use Solrj to do this or is there a better way? Can I use > >> Solrj to make the rest calls that make up the schema API? Whatever the > >> answer, can anyone point me to an example showing how to do it? Thanks! > >> > >> -- > > Regards, > > Binoy Dalal >