List of usage examples for org.apache.lucene.search.suggest DocumentDictionary DocumentDictionary
public DocumentDictionary(IndexReader reader, String field, String weightField, String payloadField,
String contextsField)
field for the terms, weightField for the weights that will be used for the the corresponding terms, payloadField for the corresponding payloads for the entry and contextsField for associated contexts. From source file:com.shaie.suggest.ContextSuggestDemo.java
License:Apache License
private void buildSuggesterIndex() throws IOException { try (DirectoryReader reader = DirectoryReader.open(indexDir)) { final Dictionary dictionary = new DocumentDictionary(reader, "content", null, null, "username"); suggester.build(dictionary);/*from w w w .jav a 2s. com*/ suggester.refresh(); } }