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

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

Introduction

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

Prototype

public boolean storeTermPositions() 

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(/*from  w w  w .  j  a va  2 s. com*/
                "Solr will use Highlighter instead of FastVectorHighlighter because {} field does not store TermPositions and TermOffsets.",
                fieldName);
    }
    return termPosOff;
}