Example usage for org.apache.solr.schema FieldProperties OMIT_TF_POSITIONS

List of usage examples for org.apache.solr.schema FieldProperties OMIT_TF_POSITIONS

Introduction

In this page you can find the example usage for org.apache.solr.schema FieldProperties OMIT_TF_POSITIONS.

Prototype

int OMIT_TF_POSITIONS

To view the source code for org.apache.solr.schema FieldProperties OMIT_TF_POSITIONS.

Click Source Link

Usage

From source file:com.sindicetech.siren.solr.schema.ExtendedJsonField.java

License:Open Source License

private void checkFieldTypeProperties() {
    if (this.isMultiValued()) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                "ExtendedJsonField types can not be multiValued: " + this.typeName);
    }/*from w  w  w . j a v a2  s  . c o  m*/
    if (!this.hasProperty(FieldProperties.OMIT_NORMS)) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                "ExtendedJsonField types must omit norms: " + this.typeName);
    }
    if (this.hasProperty(FieldProperties.OMIT_TF_POSITIONS)) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                "ExtendedJsonField types can not omit term frequencies " + "and positions: " + this.typeName);
    }
    if (this.hasProperty(FieldProperties.OMIT_POSITIONS)) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                "ExtendedJsonField types can not omit positions: " + this.typeName);
    }
    if (this.hasProperty(FieldProperties.STORE_TERMVECTORS)) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                "ExtendedJsonField types can not store term vectors: " + this.typeName);
    }
}