io.redlink.solr.suggestion.result.SuggesionResultSingle Maven / Gradle / Ivy
package io.redlink.solr.suggestion.result;
import io.redlink.solr.suggestion.SuggestionRequestHandler;
import io.redlink.solr.suggestion.params.SuggestionResultParams;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import org.apache.solr.common.util.NamedList;
public class SuggesionResultSingle implements SuggestionResult {
private int count = 0;
private int limit = Integer.MAX_VALUE;
private SuggestionRequestHandler.LimitType limitType;
private HashMap> fields = new HashMap<>();
private static final Comparator COUNT_SORTER = Comparator.naturalOrder();
public SuggesionResultSingle(int limit, SuggestionRequestHandler.LimitType limitType) {
this.limit = limit;
this.limitType = limitType;
}
public Object write() {
NamedList