Interface SearchService

  • All Superinterfaces:
    Diagnosable

    public interface SearchService
    extends Diagnosable
    Provides a search interface
    Author:
    ieb
    • Method Detail

      • search

        SearchList search​(String searchTerms,
                          List<String> contexts,
                          List<String> toolIds,
                          int start,
                          int end,
                          String filterName,
                          String sorterName)
                   throws InvalidSearchQueryException
        This is the same as standard search, but the caller can specify, by name, the index Filter and the index Sorter by name The Sorter and the Filter will be consulted during the search, and hence should not make massive demands on the framework, otherwise they will cripple the search performance
        Parameters:
        searchTerms - A search string
        contexts - A list of contexts
        start - starting from
        end - ending at
        filterName - a lucene filter
        sorterName - a lucene sorter
        Returns:
        Throws:
        InvalidSearchQueryException - if unable to parse the query
      • search

        SearchList search​(String searchTerms,
                          List<String> contexts,
                          List<String> toolIds,
                          int start,
                          int end,
                          String indexBuilderName)
                   throws InvalidSearchQueryException
        This is the same as standard search, but the caller can specify the logical name of the index builder which should execute the search.
        Parameters:
        searchTerms - A search string
        contexts - A list of contexts
        start - starting from
        end - ending at
        indexBuilderName - logical index builder name or null to fall back to default
        Returns:
        Throws:
        InvalidSearchQueryException - if unable to parse the query
      • search

        SearchList search​(String searchTerms,
                          List<String> contexts,
                          List<String> toolIds,
                          int start,
                          int end,
                          String indexBuilderName,
                          Map<String,​String> additionalSearchInformation)
                   throws InvalidSearchQueryException
        This is the same as standard search, but the caller can specify the logical name of the index builder which should execute the search and pass a more complex information in the search Terms.
        Parameters:
        searchTerms - A Map where we can define more information for the search
        contexts - A list of contexts
        start - starting from
        end - ending at
        indexBuilderName - logical index builder name or null to fall back to default
        additionalSearchInformation - extra parameters to construct more advanced queries
        Returns:
        Throws:
        InvalidSearchQueryException - if unable to parse the query
      • searchResponse

        org.elasticsearch.action.search.SearchResponse searchResponse​(String searchTerms,
                                                                      List<String> contexts,
                                                                      List<String> toolIds,
                                                                      int start,
                                                                      int end,
                                                                      String indexBuilderName,
                                                                      Map<String,​String> additionalSearchInformation)
                                                               throws InvalidSearchQueryException
        This is the same as standard search, but the caller can specify the logical name of the index builder which should execute the search and pass a more complex information in the search Terms. In this case we return the SearchResponse directly
        Parameters:
        searchTerms - A Map where we can define more information for the search
        contexts - A list of contexts
        start - starting from
        end - ending at
        indexBuilderName - logical index builder name or null to fall back to default
        additionalSearchInformation - extra parameters to construct more advanced queries
        Returns:
        Throws:
        InvalidSearchQueryException - if unable to parse the query
      • registerFunction

        void registerFunction​(String function)
        Adds a function for the SearchService to respond to and route to the index builder. EntityProducers that want their content to be searched, should register the events that indicate new data to this
        Parameters:
        function -
      • reload

        void reload()
        When reload is called, the index should be reloaded
      • refreshInstance

        void refreshInstance()
        Trigger an refresh of the whole index
      • refreshIndex

        void refreshIndex​(String indexBuilderName)
        Trigger a refresh of the named index
        Parameters:
        indexBuilderName - the name of the index to refresh
      • rebuildInstance

        void rebuildInstance()
        trigger a rebuild of the whole index
      • rebuildIndex

        void rebuildIndex​(String indexBuilderName)
        Trigger a rebuild of the named index
        Parameters:
        indexBuilderName - the name of the index to rebuild
      • refreshSite

        void refreshSite​(String currentSiteId)
        Refresh the current site only
        Parameters:
        currentSiteId -
      • rebuildSite

        void rebuildSite​(String currentSiteId)
        rebuild the current site only
        Parameters:
        currentSiteId -
      • getStatus

        String getStatus()
        get the status of the search service
        Returns:
      • getNDocs

        long getNDocs()
        get the number of documents in the search index
        Returns:
      • getPendingDocs

        int getPendingDocs()
        get the number of pending documents in the search index
        Returns:
      • getAllSearchItems

        List<SearchBuilderItem> getAllSearchItems()
        get all the search items in the index (must be a lazy load list)
        Returns:
      • getSiteMasterSearchItems

        List<SearchBuilderItem> getSiteMasterSearchItems()
        get the master itemf to sthe site
        Returns:
      • getGlobalMasterSearchItems

        List<SearchBuilderItem> getGlobalMasterSearchItems()
        get the global master items
        Returns:
      • getSearchStatus

        List<SearchStatus> getSearchStatus()
        Get the status of the search engine
        Returns:
      • removeWorkerLock

        boolean removeWorkerLock()
        force the removal of the worker lock
        Returns:
      • getSegmentInfo

        List getSegmentInfo()
      • forceReload

        void forceReload()
        Force a reload regardless of if the index has changed
      • getTerms

        TermFrequency getTerms​(int documentId)
                        throws IOException
        get the term vector for this document, where document is the
        Parameters:
        documentId -
        Returns:
        Throws:
        IOException
      • searchXML

        String searchXML​(Map parameterMap)
        generates a block of XML representing the search results
        Parameters:
        parameterMap -
        Returns:
      • isEnabled

        boolean isEnabled()
        Returns:
      • getDigestStoragePath

        String getDigestStoragePath()
        Get the storage location for Digested content. Will return null if system is Not set up to store content on the fs
        Returns:
      • getSearchSuggestion

        String getSearchSuggestion​(String searchString)
        Get a suggestion for spelling errors etc
        Parameters:
        searchString -
        Returns:
        a suggestion
      • getSearchSuggestions

        String[] getSearchSuggestions​(String searchString,
                                      String currentSite,
                                      boolean allMySites)
      • getSearchSuggestions

        String[] getSearchSuggestions​(String searchString,
                                      String currentSite,
                                      boolean allMySites,
                                      String indexBuilderName)
        Same as getSearchSuggestions(String, String, boolean), but can specify the logical name of the index builder which should execute the search.
        Parameters:
        searchString - the search terms
        currentSite - the user's current site. Will search only this site if not null and allMySites is false
        allMySites - if true, will search all of the current user's sites
        indexBuilderName - logical index builder name or null to fall back to default
        Returns:
      • isSearchServer

        boolean isSearchServer()
        SRCH-96 whether the current server is of search server or not
        Returns:
      • getIndexBuilderNames

        Set<String> getIndexBuilderNames()
        Returns:
        the list of search index builder names