Class KendraSearchProvider

  • All Implemented Interfaces:
    WikiProvider, SearchProvider

    public class KendraSearchProvider
    extends java.lang.Object
    implements SearchProvider
    Search provider that implements {link SearchProvider} using AWS Kendra for indexing. Note that we are using a Custom DataSource which limits the attributes that can be uploaded / searched for each page (as per This could be overcome by using an S3 bucket where any custom attributes can be added.
    • Method Detail

      • initialize

        public void initialize​(Engine engine,
                               java.util.Properties properties)
                        throws NoRequiredPropertyException,
        Initializes the page provider.
        Specified by:
        initialize in interface WikiProvider
        engine - Engine to own this provider
        properties - A set of properties used to initialize this provider
        NoRequiredPropertyException - If the provider needs a property which is not found in the property set - If there is an IO problem
      • getProviderInfo

        public java.lang.String getProviderInfo()
        Return a valid HTML string for information. May be anything.
        Specified by:
        getProviderInfo in interface WikiProvider
        A string describing the provider.
      • pageRemoved

        public void pageRemoved​(Page page)
        Delete a page from the search index.
        Specified by:
        pageRemoved in interface SearchProvider
        page - Page to remove from search index.
      • reindexPage

        public void reindexPage​(Page page)
        Adds a WikiPage for indexing queue. This is called a queue, since this method is expected to return pretty quickly, and indexing to be done in a separate thread.
        Specified by:
        reindexPage in interface SearchProvider
        page - The WikiPage to be indexed.
      • findPages

        public java.util.Collection<SearchResultfindPages​(java.lang.String query,
                                                            Context wikiContext)
                                                     throws ProviderException,
        Search for pages matching a search query.
        Specified by:
        findPages in interface SearchProvider
        query - query to search for
        wikiContext - the context within which to run the search
        collection of pages that match query
        ProviderException - if the search provider failed. - if for some reason the query could not be executed.
      • initializeIndexAndDataSource

        public void initializeIndexAndDataSource()
        This method initialize the AWS Kendra Index and Datasources to be used.
      • getKendra

        public getKendra()
      • setKendra

        public void setKendra​( kendra)
      • buildClient

        protected buildClient()