package com.winterwell.es.client.query;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import com.goodloop.egbot.server.min_doc_freq;
import com.winterwell.utils.ReflectionUtils;
import com.winterwell.utils.containers.ArrayMap;
import com.winterwell.utils.log.Log;

/**
 * See https://www.elastic.co/guide/en/elasticsearch/reference/6.3/query-dsl-mlt-query.html
 * @author daniel
 *
 */
public class MoreLikeThisQueryBuilder extends ESQueryBuilder {

	public MoreLikeThisQueryBuilder() {
		this(new ArrayMap("more_like_this", new ArrayMap()));
	}
	
	public MoreLikeThisQueryBuilder(Map query) {
		super(query);
	}

	public MoreLikeThisQueryBuilder(String like) {
		this();
		props.put("like", like);
	}

	public MoreLikeThisQueryBuilder setFields(Collection<String> fields) {
		props.put("fields", fields);
		return this;
	}

	public MoreLikeThisQueryBuilder setMinTermFreq(int i) {
		props.put("min_term_freq", i);
		return this;
	}

	public MoreLikeThisQueryBuilder setMinDocFreq(int i) {
		props.put("min_doc_freq", i);
		return this;
	}
	
}

@@ -38,36 +38,8 @@
 y;%0A%0A
-import java.util.ArrayList;%0A
 impo
@@ -84,127 +84,11 @@
 til.
-List;%0Aimport java.util.Map;%0A%0Aimport com.goodloop.egbot.server.min_doc_freq;%0Aimport com.winterwell.utils.ReflectionUtils
+Map
 ;%0Aim
@@ -137,45 +137,8 @@
 Map;
-%0Aimport com.winterwell.utils.log.Log;
 %0A%0A/*

Remove stray egbot import from MoreLikeThisQueryBuilder