package eu.dnetlib.api.data;

import java.util.Collection;

import eu.dnetlib.api.DriverService;
import eu.dnetlib.domain.data.SearchResult;
import eu.dnetlib.domain.data.SuggestiveResult;

public interface SearchService extends DriverService {

	/**
	 * 
	 * @param queryText the query
	 * @param transformer the name of the transformer for search results
	 * @param format the format 
	 * @param locale the locale
	 * @param page the search result page 
	 * @param size the search result page size
	 * @return {@link SearchResult} containing the request parameters and the list of search result records
	 * 
	 * @throws SearchServiceException
	 */
	public SearchResult search(String queryText, String transformer, String format,
			String locale, int page, int size) throws SearchServiceException;

	/**
	 * 
	 * @param queryText the query
	 * @param transformer the name of the transformer for refine results
	 * @param format the format
	 * @param locale the locale
	 * @param fields the fields to include in refine results
	 * @return {@link SearchResult} containing the request parameters and the list of refine records
	 * 
	 * @throws SearchServiceException 
	 */
	public SearchResult refine(String queryText, String transformer, String format,
			String locale, Collection<String> fields) throws SearchServiceException;

	/**
	 * 
	 * @param queryText the query 
	 * @param searchTransformer the transformer of search results
	 * @param refineTransformer the transformer of refine results
	 * @param format the format
	 * @param locale the locale
	 * @param page the search result page
	 * @param size the search result page size
	 * @param fields the fields to include in refine
	 * @return {@link SearchResult} containing the request parameters, the list 
	 * of search records and the list of refine records 
	 * 
	 * @throws SearchServiceException
	 */
	public SearchResult searchNrefine(String queryText, String searchTransformer,
			String refineTransformer, String format, String locale, int page,
			int size, Collection<String> fields) throws SearchServiceException;

	public SuggestiveResult suggestiveSearch(String query) throws SearchServiceException;

}