Example usage for org.apache.solr.schema SchemaField storeTermOffsets

List of usage examples for org.apache.solr.schema SchemaField storeTermOffsets

Introduction

In this page you can find the example usage for org.apache.solr.schema SchemaField storeTermOffsets.

Prototype

public boolean storeTermOffsets() 

Source Link

Usage

From source file:com.o19s.solr.swan.highlight.SwanHighlighter.java

License:Apache License

private boolean useFastVectorHighlighter(SolrParams params, IndexSchema schema, String fieldName) {
    SchemaField schemaField = schema.getFieldOrNull(fieldName);
    if (schemaField == null)
        return false;
    boolean useFvhParam = params.getFieldBool(fieldName, HighlightParams.USE_FVH, false);
    if (!useFvhParam)
        return false;
    boolean termPosOff = schemaField.storeTermPositions() && schemaField.storeTermOffsets();
    if (!termPosOff) {
        log.warn(//w w w  .j av  a2  s .c  o m
                "Solr will use Highlighter instead of FastVectorHighlighter because {} field does not store TermPositions and TermOffsets.",
                fieldName);
    }
    return termPosOff;
}