Class DiscoverQueryBuilder

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean

    @Component
    public class DiscoverQueryBuilder
    extends Object
    implements org.springframework.beans.factory.InitializingBean
    This class builds the queries for the /search and /facet endpoints.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()  
      org.dspace.discovery.DiscoverQuery buildFacetQuery​(org.dspace.core.Context context, org.dspace.discovery.IndexableObject scope, org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration, String prefix, String query, List<SearchFilter> searchFilters, String dsoType, org.springframework.data.domain.Pageable page, String facetName)
      Create a discovery facet query.
      org.dspace.discovery.DiscoverQuery buildFacetQuery​(org.dspace.core.Context context, org.dspace.discovery.IndexableObject scope, org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration, String prefix, String query, List<SearchFilter> searchFilters, List<String> dsoTypes, org.springframework.data.domain.Pageable page, String facetName)
      Create a discovery facet query.
      org.dspace.discovery.DiscoverQuery buildQuery​(org.dspace.core.Context context, org.dspace.discovery.IndexableObject scope, org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration, String query, List<SearchFilter> searchFilters, String dsoType, org.springframework.data.domain.Pageable page)
      Build a discovery query
      org.dspace.discovery.DiscoverQuery buildQuery​(org.dspace.core.Context context, org.dspace.discovery.IndexableObject scope, org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration, String query, List<SearchFilter> searchFilters, List<String> dsoTypes, org.springframework.data.domain.Pageable page)
      Build a discovery query
      void setIndexableFactories​(List<org.dspace.discovery.indexobject.factory.IndexFactory> indexableFactories)  
    • Constructor Detail

      • DiscoverQueryBuilder

        public DiscoverQueryBuilder()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • buildQuery

        public org.dspace.discovery.DiscoverQuery buildQuery​(org.dspace.core.Context context,
                                                             org.dspace.discovery.IndexableObject scope,
                                                             org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration,
                                                             String query,
                                                             List<SearchFilter> searchFilters,
                                                             String dsoType,
                                                             org.springframework.data.domain.Pageable page)
                                                      throws DSpaceBadRequestException
        Build a discovery query
        Parameters:
        context - the DSpace context
        scope - the scope for this discovery query
        discoveryConfiguration - the discovery configuration for this discovery query
        query - the query string for this discovery query
        searchFilters - the search filters for this discovery query
        dsoType - only include search results with this type
        page - the pageable for this discovery query
        Throws:
        DSpaceBadRequestException
      • buildQuery

        public org.dspace.discovery.DiscoverQuery buildQuery​(org.dspace.core.Context context,
                                                             org.dspace.discovery.IndexableObject scope,
                                                             org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration,
                                                             String query,
                                                             List<SearchFilter> searchFilters,
                                                             List<String> dsoTypes,
                                                             org.springframework.data.domain.Pageable page)
                                                      throws DSpaceBadRequestException
        Build a discovery query
        Parameters:
        context - the DSpace context
        scope - the scope for this discovery query
        discoveryConfiguration - the discovery configuration for this discovery query
        query - the query string for this discovery query
        searchFilters - the search filters for this discovery query
        dsoTypes - only include search results with one of these types
        page - the pageable for this discovery query
        Throws:
        DSpaceBadRequestException
      • buildFacetQuery

        public org.dspace.discovery.DiscoverQuery buildFacetQuery​(org.dspace.core.Context context,
                                                                  org.dspace.discovery.IndexableObject scope,
                                                                  org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration,
                                                                  String prefix,
                                                                  String query,
                                                                  List<SearchFilter> searchFilters,
                                                                  String dsoType,
                                                                  org.springframework.data.domain.Pageable page,
                                                                  String facetName)
                                                           throws DSpaceBadRequestException
        Create a discovery facet query.
        Parameters:
        context - the DSpace context
        scope - the scope for this discovery query
        discoveryConfiguration - the discovery configuration for this discovery query
        prefix - limit the facets results to those starting with the given prefix.
        query - the query string for this discovery query
        searchFilters - the search filters for this discovery query
        dsoType - only include search results with this type
        page - the pageable for this discovery query
        facetName - the facet field
        Throws:
        DSpaceBadRequestException
      • buildFacetQuery

        public org.dspace.discovery.DiscoverQuery buildFacetQuery​(org.dspace.core.Context context,
                                                                  org.dspace.discovery.IndexableObject scope,
                                                                  org.dspace.discovery.configuration.DiscoveryConfiguration discoveryConfiguration,
                                                                  String prefix,
                                                                  String query,
                                                                  List<SearchFilter> searchFilters,
                                                                  List<String> dsoTypes,
                                                                  org.springframework.data.domain.Pageable page,
                                                                  String facetName)
                                                           throws DSpaceBadRequestException
        Create a discovery facet query.
        Parameters:
        context - the DSpace context
        scope - the scope for this discovery query
        discoveryConfiguration - the discovery configuration for this discovery query
        prefix - limit the facets results to those starting with the given prefix.
        query - the query string for this discovery query
        searchFilters - the search filters for this discovery query
        dsoTypes - only include search results with one of these types
        page - the pageable for this discovery query
        facetName - the facet field
        Throws:
        DSpaceBadRequestException
      • setIndexableFactories

        public void setIndexableFactories​(List<org.dspace.discovery.indexobject.factory.IndexFactory> indexableFactories)