package uk.ac.ebi.biosamples.solr.repo;

import org.springframework.data.domain.Pageable;
import org.springframework.data.solr.core.query.result.FacetPage;
import org.springframework.data.solr.core.query.result.SolrResultPage;
import org.springframework.data.solr.repository.Facet;
import org.springframework.data.solr.repository.Query;
import org.springframework.data.solr.repository.SolrCrudRepository;

import uk.ac.ebi.biosamples.solr.model.SolrSample;

public interface SolrSampleRepository extends SolrCrudRepository<SolrSample, String> {

	@Query(value = "?0")
	FacetPage<SolrSample> findByText(String text, Pageable page);
	@Query(value = "?0")
	@Facet(fields = { "organism_av_ss" }, limit = 10)
	FacetPage<SolrSample> findByTextWithFacets(String text, Pageable page);
	@Query(value = "?0")
	@Facet(fields = { "attributetypes_ss" }, limit = 10)
	FacetPage<SolrSample> findByTextWithFacetTypes(String text, Pageable page);

	@Query(value = "?0 AND release_dt:[* TO NOW]")
	FacetPage<SolrSample> findByTextAndPublic(String text, Pageable page);
	@Query(value = "?0 AND release_dt:[* TO NOW]")
	@Facet(fields = { "?1", "?2", "?3", "?4", "?5", "?6", "?7", "?8", "?9", "?10"}, limit = 10)
	FacetPage<SolrSample> findByTextAndPublicWithFacets(String text, String facet1, String facet2, 
			String facet3, String facet4, String facet5, String facet6, String facet7, String facet8, 
			String facet9, String facet10, Pageable page);
	@Query(value = "?0 AND release_dt:[* TO NOW]")
	@Facet(fields = { "attributetypes_ss" }, limit = 10)
	FacetPage<SolrSample> findByTextAndPublicWithFacetTypes(String text, Pageable page);

	@Query(value = "release_dt:[* TO NOW]")
	FacetPage<SolrSample> findPublic(Pageable page);
	@Query(value = "release_dt:[* TO NOW]")
	@Facet(fields = { "organism_av_ss" }, limit = 10)
	FacetPage<SolrSample> findPublicWithFacets(Pageable page);
	
}

@@ -650,154 +650,8 @@
 0%22)%0A
-%09@Facet(fields = %7B %22organism_av_ss%22 %7D, limit = 10)%0A%09FacetPage%3CSolrSample%3E findByTextWithFacets(String text, Pageable page);%0A%09@Query(value = %22?0%22)%0A
 %09@Fa
@@ -950,390 +950,8 @@
 %5D%22)%0A
-%09@Facet(fields = %7B %22?1%22, %22?2%22, %22?3%22, %22?4%22, %22?5%22, %22?6%22, %22?7%22, %22?8%22, %22?9%22, %22?10%22%7D, limit = 10)%0A%09FacetPage%3CSolrSample%3E findByTextAndPublicWithFacets(String text, String facet1, String facet2, %0A%09%09%09String facet3, String facet4, String facet5, String facet6, String facet7, String facet8, %0A%09%09%09String facet9, String facet10, Pageable page);%0A%09@Query(value = %22?0 AND release_dt:%5B* TO NOW%5D%22)%0A
 %09@Fa

remove unused methods