### Question:
MultiMatch extends ESFunction { @Override public QueryBuilder buildQuery() { String minimumShouldMatch = getParameters().get(getParameters().size() -1).getStringValue(); String value = getParameters().get(getParameters().size() -2).getStringValue(); String[] fields = new String[getParameters().size() -2]; for (int i = 0; i < getParameters().size() -2; i++){ if (getParameters().get(i) instanceof ColumnSelector){ fields[i]=((ColumnSelector) getParameters().get(i)).getColumnName().getName(); }else{ fields[i]= getParameters().get(i).getStringValue(); } } return QueryBuilders.multiMatchQuery(value, fields).minimumShouldMatch(minimumShouldMatch); } protected  MultiMatch(List<Selector> parameters); @Override QueryBuilder buildQuery();  }### Answer:
@Test public void testMatch() throws UnsupportedException, ExecutionException { List<Selector> parameters = new ArrayList<>(); TableName tableName = new TableName("catalog", "table"); parameters.add(new ColumnSelector(new ColumnName(tableName, "colName"))); parameters.add(new ColumnSelector(new ColumnName(tableName, "col2Name"))); parameters.add(new StringSelector("*_colName")); parameters.add(new StringSelector("value")); parameters.add(new StringSelector("1")); FunctionRelation function = new FunctionRelation(ESFunction.MULTI_MATCH, parameters,tableName); ESFunction match = ESFunction.build(function); QueryBuilder builder = match.buildQuery(); String expected = "{\"multi_match\":{\"query\":\"value\",\"fields\":[\"colName\",\"col2Name\",\"*_colName\"],\"minimum_should_match\":\"1\"}}"; Assert.assertEquals(expected, builder.toString().replaceAll("\\s+", "")); }