Example usage for org.apache.solr.common.params SolrParams getFieldBool

List of usage examples for org.apache.solr.common.params SolrParams getFieldBool

Introduction

In this page you can find the example usage for org.apache.solr.common.params SolrParams getFieldBool.

Prototype

public boolean getFieldBool(String field, String param, boolean def) 

Source Link

Document

Returns the boolean value of the field param, or the value for param, or def if neither is set.

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  a2s.co  m*/
                "Solr will use Highlighter instead of FastVectorHighlighter because {} field does not store TermPositions and TermOffsets.",
                fieldName);
    }
    return termPosOff;
}