Example usage for org.apache.solr.schema IndexSchema getSchemaName

List of usage examples for org.apache.solr.schema IndexSchema getSchemaName

Introduction

In this page you can find the example usage for org.apache.solr.schema IndexSchema getSchemaName.

Prototype

public String getSchemaName() 

Source Link

Document

Gets the name of the schema as specified in the schema resource.

Usage

From source file:uk.co.flax.biosolr.builders.AbstractFacetTreeBuilder.java

License:Apache License

protected void checkFieldsInSchema(SolrIndexSearcher searcher, Collection<String> fields) throws SolrException {
    IndexSchema schema = searcher.getSchema();
    for (String field : fields) {
        SchemaField sField = schema.getField(field);
        if (sField == null) {
            throw new SolrException(ErrorCode.BAD_REQUEST,
                    "\"" + field + "\" is not in schema " + schema.getSchemaName());
        }//w w  w . j a  v  a  2  s . c  o  m
    }
}