Example usage for org.apache.solr.spelling SolrSpellChecker build

List of usage examples for org.apache.solr.spelling SolrSpellChecker build

Introduction

In this page you can find the example usage for org.apache.solr.spelling SolrSpellChecker build.

Prototype

public abstract void build(SolrCore core, SolrIndexSearcher searcher) throws IOException;

Source Link

Document

(re)Builds the spelling index.

Usage

From source file:org.dice.solrenhancements.spellchecker.DiceSpellCheckComponent.java

License:Apache License

@Override
@SuppressWarnings("unchecked")
public void prepare(ResponseBuilder rb) throws IOException {

    SolrParams params = rb.req.getParams();
    if (!params.getBool(COMPONENT_NAME, false)) {
        return;//from   w w w . jav  a  2 s.  c om
    }
    SolrSpellChecker spellChecker = getSpellChecker(params);
    if (params.getBool(SPELLCHECK_BUILD, false)) {
        spellChecker.build(rb.req.getCore(), rb.req.getSearcher());
        rb.rsp.add("command", "build");
    } else if (params.getBool(SPELLCHECK_RELOAD, false)) {
        spellChecker.reload(rb.req.getCore(), rb.req.getSearcher());
        rb.rsp.add("command", "reload");
    }
}