Interface Index


  • public interface Index
    The Interface Index.
    Facades the Index and Search process.
    • Method Detail

      • getField

        nl.gx.webmanager.services.solr.api.FieldDefinition getField​(String identifier,
                                                                    Locale language)
        Returns the field definition that has the specified identifier. If possible, the field is returned for the given languages. If not, i.e. a language does not exist for the field, the language agnostic field is returned. The same holds if language is null.
        Parameters:
        identifier - the identifier
        language - the language of the field to return
        Returns:
        the field definition
      • findDocumentTypes

        List<String> findDocumentTypes()
        Returns a list of all types used in this index.
        Returns:
        all document types
      • findStoredFields

        List<nl.gx.webmanager.services.solr.api.FieldDefinition> findStoredFields​(List<String> types,
                                                                                  List<Locale> languages)
        Returns all stored fields that are defined for this index.
        Parameters:
        types - the (content) type the fields should apply to
        languages - the languages of the stored fields to retrieve, or an empty list
        Returns:
        the stored fields
      • findSearchFields

        List<nl.gx.webmanager.services.solr.api.FieldDefinition> findSearchFields​(List<String> types,
                                                                                  List<Locale> languages)
        Returns all search fields that are defined for this index.
        Parameters:
        types - the (content) type the fields should apply to
        languages - the languages of the search fields to retrieve, or an empty list
        Returns:
        the search fields
      • findFacetFields

        List<nl.gx.webmanager.services.solr.api.FieldDefinition> findFacetFields​(List<String> types,
                                                                                 Locale language)
        Returns all facet fields that are defined for this index.
        Parameters:
        types - the (content) type the facets should apply to
        language - the language of the facet fields to retrieve, or null
        Returns:
        the facet fields
      • fieldExists

        boolean fieldExists​(String fieldName)
        Returns whether a field exists in the index.
        Parameters:
        fieldName - the field name
        Returns:
        true or false
      • update

        void update​(List<?> content)
             throws IndexException
        Update.
        Will update the index with the given content.
        Parameters:
        content - the content to be indexed, may not be null.
        Throws:
        IndexException - if an exception occurred during the index process, will wrap the actual cause.
      • purgeById

        void purgeById​(List<String> id)
                throws IndexException
        Purge By Id.
        Will purge from the index all content matching the given array of id.
        Parameters:
        id - the List of id's to delete, may not be null.
        Throws:
        IndexException - if an exception occurred during the delete process, will wrap the actual cause.
      • purgeAll

        void purgeAll()
               throws IndexException
        Purge All.
        Will purge the entire index of all content
        Throws:
        IndexException - the index exception, if an exception occurred during the purging process.
      • purgeByDomain

        void purgeByDomain​(List<ContentDomain<?>> contentDomains)
                    throws IndexException
        Purge By Domain.
        Will purge the entire index of the content which has a type that exists in the given contentDomains
        Parameters:
        contentDomains - the content domains to purge, may not be null.
        Throws:
        IndexException - if any exception occurred during the purge process.
      • optimize

        void optimize()
               throws IndexException
        Optimize.
        On callback will optimize the index, merges all possible segments into one complete index
        Throws:
        IndexException - the index exception
      • query

        org.apache.solr.client.solrj.response.QueryResponse query​(org.apache.solr.common.params.SolrParams query)
                                                           throws SearchException
        Query.
        Exposes a SolrParams interface and returns a a QueryResponse.
        Parameters:
        query - the query to be executed, may not be null.
        Returns:
        the query response returned.
        Throws:
        SearchException - if an exception occurred during the index process, will wrap the actual cause.