Search in sources :

Example 1 with SchemaXmlWriter

use of org.apache.solr.response.SchemaXmlWriter in project lucene-solr by apache.

the class IndexSchema method persist.

/**
   * Writes the schema in schema.xml format to the given writer 
   */
void persist(Writer writer) throws IOException {
    final SolrQueryResponse response = new SolrQueryResponse();
    response.add(IndexSchema.SCHEMA, getNamedPropertyValues());
    final SolrParams args = (new ModifiableSolrParams()).set("indent", "on");
    final LocalSolrQueryRequest req = new LocalSolrQueryRequest(null, args);
    final SchemaXmlWriter schemaXmlWriter = new SchemaXmlWriter(writer, req, response);
    schemaXmlWriter.setEmitManagedSchemaDoNotEditWarning(true);
    schemaXmlWriter.writeResponse();
    schemaXmlWriter.close();
}
Also used : LocalSolrQueryRequest(org.apache.solr.request.LocalSolrQueryRequest) SolrQueryResponse(org.apache.solr.response.SolrQueryResponse) SolrParams(org.apache.solr.common.params.SolrParams) ModifiableSolrParams(org.apache.solr.common.params.ModifiableSolrParams) MapSolrParams(org.apache.solr.common.params.MapSolrParams) SchemaXmlWriter(org.apache.solr.response.SchemaXmlWriter) ModifiableSolrParams(org.apache.solr.common.params.ModifiableSolrParams)

Aggregations

MapSolrParams (org.apache.solr.common.params.MapSolrParams)1 ModifiableSolrParams (org.apache.solr.common.params.ModifiableSolrParams)1 SolrParams (org.apache.solr.common.params.SolrParams)1 LocalSolrQueryRequest (org.apache.solr.request.LocalSolrQueryRequest)1 SchemaXmlWriter (org.apache.solr.response.SchemaXmlWriter)1 SolrQueryResponse (org.apache.solr.response.SolrQueryResponse)1