List of usage examples for org.apache.lucene.search.suggest DocumentDictionary DocumentDictionary
public DocumentDictionary(IndexReader reader, String field, String weightField, String payloadField)
field for the terms, weightField for the weights that will be used for the the corresponding terms and payloadField for the corresponding payloads for the entry. From source file:org.apache.solr.spelling.suggest.DocumentDictionaryFactory.java
License:Apache License
@Override public Dictionary create(SolrCore core, SolrIndexSearcher searcher) { if (params == null) { // should not happen; implies setParams was not called throw new IllegalStateException("Value of params not set"); }/* w w w . java 2s. c o m*/ String field = (String) params.get(FIELD); String weightField = (String) params.get(WEIGHT_FIELD); String payloadField = (String) params.get(PAYLOAD_FIELD); if (field == null) { throw new IllegalArgumentException(FIELD + " is a mandatory parameter"); } if (weightField == null) { throw new IllegalArgumentException(WEIGHT_FIELD + " is a mandatory parameter"); } return new DocumentDictionary(searcher.getIndexReader(), field, weightField, payloadField); }