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

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

Introduction

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

Prototype

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

Source Link

Document

Reloads the 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 ww w .j  av a 2  s  .  co  m*/
    }
    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");
    }
}