Example usage for org.apache.solr.common.params SpellingParams SPELLCHECK_PREFIX

List of usage examples for org.apache.solr.common.params SpellingParams SPELLCHECK_PREFIX

Introduction

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

Prototype

String SPELLCHECK_PREFIX

To view the source code for org.apache.solr.common.params SpellingParams SPELLCHECK_PREFIX.

Click Source Link

Usage

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

License:Apache License

/**
 * For every param that is of the form "spellcheck.[dictionary name].XXXX=YYYY, add
 * XXXX=YYYY as a param to the custom param list
 * @param params The original SolrParams
 * @return The new Params//from  w w w  . ja va 2  s  .c  om
 */
protected SolrParams getCustomParams(String dictionary, SolrParams params) {
    ModifiableSolrParams result = new ModifiableSolrParams();
    Iterator<String> iter = params.getParameterNamesIterator();
    String prefix = SpellingParams.SPELLCHECK_PREFIX + "." + dictionary + ".";
    while (iter.hasNext()) {
        String nxt = iter.next();
        if (nxt.startsWith(prefix)) {
            result.add(nxt.substring(prefix.length()), params.getParams(nxt));
        }
    }
    return result;
}