// Path: elasticservice/src/main/java/elasticsearch/searchservice/models/Meta.java
// public class Meta {
//     private String key;
//     private List<String> value;
//     private String operator;
// 
//     public Meta() {}
//     public Meta(String key, List<String> value, String operator) {
//         this.key = key;
//         this.value = value;
//         this.operator = operator;
//     }
// 
//     public String getKey() {
//         return key;
//     }
// 
//     public void setKey(String key) {
//         this.key = key;
//     }
// 
//     public List<String> getValue() {
//         return value;
//     }
// 
//     public void setValue(List<String> value) {
//         this.value = value;
//     }
// 
//     public String getOperator() {
//         return operator;
//     }
// 
//     public void setOperator(String operator) {
//         this.operator = operator;
//     }
// }
// 
// Path: elasticservice/src/main/java/elasticsearch/searchservice/models/QueryParam.java
// public class QueryParam {
//     private List<Meta> filter;
//     private Collection collection;
//     private String orderByField;
//     private String orderByOrder;
//     private Long channelId;
//     private Integer pageSize;
//     private Integer offSet;
//     private Boolean isCount = Boolean.FALSE;
// 
//     public List<Meta> getFilter() {
//         return filter;
//     }
// 
//     public void setFilter(List<Meta> filter) {
//         this.filter = filter;
//     }
// 
//     public Collection getCollection() {
//         return collection;
//     }
// 
//     public void setCollection(Collection collection) {
//         this.collection = collection;
//     }
// 
//     public String getOrderByField() {
//         return orderByField;
//     }
// 
//     public void setOrderByField(String orderByField) {
//         this.orderByField = orderByField;
//     }
// 
//     public String getOrderByOrder() {
//         return orderByOrder;
//     }
// 
//     public void setOrderByOrder(String orderByOrder) {
//         this.orderByOrder = orderByOrder;
//     }
// 
//     public Integer getPageSize() {
//         return pageSize;
//     }
// 
//     public void setPageSize(Integer pageSize) {
//         this.pageSize = pageSize;
//     }
// 
//     public Integer getOffSet() {
//         return offSet;
//     }
// 
//     public void setOffSet(Integer offSet) {
//         this.offSet = offSet;
//     }
// 
//     public Long getChannelId() {
//         return channelId;
//     }
// 
//     public void setChannelId(Long channelId) {
//         this.channelId = channelId;
//     }
// 
//     public Boolean getCount() {
//         return isCount;
//     }
// 
//     public void setCount(Boolean count) {
//         isCount = count;
//     }
// }


import com.mitchellbosecke.pebble.PebbleEngine;
import com.mitchellbosecke.pebble.error.PebbleException;
import com.mitchellbosecke.pebble.template.PebbleTemplate;
import elasticsearch.searchservice.models.Meta;
import elasticsearch.searchservice.models.QueryParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.*;

package elasticsearch.searchservice.dsl;



/**
 * Created by i311352 on 5/3/2017.
 */
@Service
public class DLSGenerateServiceImpl implements DSLGenerateService {
    private static final Logger logger = LoggerFactory.getLogger(DLSGenerateServiceImpl.class);
    private static String SYSFIELD = "systemField";
    private static String UDFFIELD = "customField";
    private static String VARIANT  = "sku.variantList.variantValueId";
    private static String FULLSEARCH = "keywords";
    private static String PRICEFIELD = "channels.prices.price";
    private static String CATEGORY = "category.order";
    private static String ATTRIBUTES = "attributes";

    private final PebbleEngine engine = new PebbleEngine.Builder().build();

    @Override

// Path: elasticservice/src/main/java/elasticsearch/searchservice/models/Meta.java
// public class Meta {
//     private String key;
//     private List<String> value;
//     private String operator;
// 
//     public Meta() {}
//     public Meta(String key, List<String> value, String operator) {
//         this.key = key;
//         this.value = value;
//         this.operator = operator;
//     }
// 
//     public String getKey() {
//         return key;
//     }
// 
//     public void setKey(String key) {
//         this.key = key;
//     }
// 
//     public List<String> getValue() {
//         return value;
//     }
// 
//     public void setValue(List<String> value) {
//         this.value = value;
//     }
// 
//     public String getOperator() {
//         return operator;
//     }
// 
//     public void setOperator(String operator) {
//         this.operator = operator;
//     }
// }
// 
// Path: elasticservice/src/main/java/elasticsearch/searchservice/models/QueryParam.java
// public class QueryParam {
//     private List<Meta> filter;
//     private Collection collection;
//     private String orderByField;
//     private String orderByOrder;
//     private Long channelId;
//     private Integer pageSize;
//     private Integer offSet;
//     private Boolean isCount = Boolean.FALSE;
// 
//     public List<Meta> getFilter() {
//         return filter;
//     }
// 
//     public void setFilter(List<Meta> filter) {
//         this.filter = filter;
//     }
// 
//     public Collection getCollection() {
//         return collection;
//     }
// 
//     public void setCollection(Collection collection) {
//         this.collection = collection;
//     }
// 
//     public String getOrderByField() {
//         return orderByField;
//     }
// 
//     public void setOrderByField(String orderByField) {
//         this.orderByField = orderByField;
//     }
// 
//     public String getOrderByOrder() {
//         return orderByOrder;
//     }
// 
//     public void setOrderByOrder(String orderByOrder) {
//         this.orderByOrder = orderByOrder;
//     }
// 
//     public Integer getPageSize() {
//         return pageSize;
//     }
// 
//     public void setPageSize(Integer pageSize) {
//         this.pageSize = pageSize;
//     }
// 
//     public Integer getOffSet() {
//         return offSet;
//     }
// 
//     public void setOffSet(Integer offSet) {
//         this.offSet = offSet;
//     }
// 
//     public Long getChannelId() {
//         return channelId;
//     }
// 
//     public void setChannelId(Long channelId) {
//         this.channelId = channelId;
//     }
// 
//     public Boolean getCount() {
//         return isCount;
//     }
// 
//     public void setCount(Boolean count) {
//         isCount = count;
//     }
// }


// Path: elasticservice/src/main/java/elasticsearch/searchservice/dsl/DLSGenerateServiceImpl.java
import com.mitchellbosecke.pebble.PebbleEngine;
import com.mitchellbosecke.pebble.error.PebbleException;
import com.mitchellbosecke.pebble.template.PebbleTemplate;
import elasticsearch.searchservice.models.Meta;
import elasticsearch.searchservice.models.QueryParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.*;

package elasticsearch.searchservice.dsl;



/**
 * Created by i311352 on 5/3/2017.
 */
@Service
public class DLSGenerateServiceImpl implements DSLGenerateService {
    private static final Logger logger = LoggerFactory.getLogger(DLSGenerateServiceImpl.class);
    private static String SYSFIELD = "systemField";
    private static String UDFFIELD = "customField";
    private static String VARIANT  = "sku.variantList.variantValueId";
    private static String FULLSEARCH = "keywords";
    private static String PRICEFIELD = "channels.prices.price";
    private static String CATEGORY = "category.order";
    private static String ATTRIBUTES = "attributes";

    private final PebbleEngine engine = new PebbleEngine.Builder().build();

    @Override

    public String fromQueryParam(QueryParam param) {
