package com.jay.monitor.data.server.componts;

import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.index.query.QueryBuilder;
import org.zxp.esclientrhl.repository.ElasticsearchTemplate;
import org.zxp.esclientrhl.repository.PageList;
import org.zxp.esclientrhl.repository.Sort;

import java.util.List;

public interface ElasticSearchPartition<T, M> extends ElasticsearchTemplate<T, M> {

    public boolean savePartition(T indexEntity, String indexName, String routes) throws Exception;

    BulkResponse[] saveBatchPartition(List<T> indexList, String indexName) throws Exception;

    public List<T> searchPartition(String indexName, T t) throws Exception;

    public PageList<T> searchPartitionPage(String indexName, T t, int pageNo, int pageSize, Sort.Order[] sort)
        throws Exception;

    public PageList<T> searchPartitionPage(String indexName, QueryBuilder queryBuilder, int pageNo, int pageSize,
        Class clazz, Sort.Order[] sort) throws Exception;
}
