Package org.apache.wiki.search.kendra
Class KendraSearchProvider
- java.lang.Object
- 
- org.apache.wiki.search.kendra.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 https://docs.aws.amazon.com/kendra/latest/dg/custom-attributes.html). This could be overcome by using an S3 bucket where any custom attributes can be added.- Since:
- 2.11.0
 
- 
- 
Field Summary- 
Fields inherited from interface org.apache.wiki.api.providers.WikiProviderLATEST_VERSION
 
- 
 - 
Constructor SummaryConstructors Constructor Description KendraSearchProvider()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.amazonaws.services.kendra.AWSkendrabuildClient()java.util.Collection<SearchResult>findPages(java.lang.String query, Context wikiContext)Search for pages matching a search query.java.lang.StringgetDataSourceName()java.lang.StringgetIndexName()com.amazonaws.services.kendra.AWSkendragetKendra()java.lang.StringgetProviderInfo()Return a valid HTML string for information.voidinitialize(Engine engine, java.util.Properties properties)Initializes the page provider.voidinitializeIndexAndDataSource()This method initialize the AWS Kendra Index and Datasources to be used.voidpageRemoved(Page page)Delete a page from the search index.voidreindexPage(Page page)Adds a WikiPage for indexing queue.voidsetKendra(com.amazonaws.services.kendra.AWSkendra kendra)
 
- 
- 
- 
Constructor Detail- 
KendraSearchProviderpublic KendraSearchProvider() 
 
- 
 - 
Method Detail- 
initializepublic void initialize(Engine engine, java.util.Properties properties) throws NoRequiredPropertyException, java.io.IOException Initializes the page provider.- Specified by:
- initializein interface- WikiProvider
- Parameters:
- engine- Engine to own this provider
- properties- A set of properties used to initialize this provider
- Throws:
- NoRequiredPropertyException- If the provider needs a property which is not found in the property set
- java.io.IOException- If there is an IO problem
 
 - 
getProviderInfopublic java.lang.String getProviderInfo() Return a valid HTML string for information. May be anything.- Specified by:
- getProviderInfoin interface- WikiProvider
- Returns:
- A string describing the provider.
 
 - 
pageRemovedpublic void pageRemoved(Page page) Delete a page from the search index.- Specified by:
- pageRemovedin interface- SearchProvider
- Parameters:
- page- Page to remove from search index.
 
 - 
reindexPagepublic 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:
- reindexPagein interface- SearchProvider
- Parameters:
- page- The WikiPage to be indexed.
 
 - 
findPagespublic java.util.Collection<SearchResult> findPages(java.lang.String query, Context wikiContext) throws ProviderException, java.io.IOException Search for pages matching a search query.- Specified by:
- findPagesin interface- SearchProvider
- Parameters:
- query- query to search for
- wikiContext- the context within which to run the search
- Returns:
- collection of pages that match query
- Throws:
- ProviderException- if the search provider failed.
- java.io.IOException- if for some reason the query could not be executed.
 
 - 
initializeIndexAndDataSourcepublic void initializeIndexAndDataSource() This method initialize the AWS Kendra Index and Datasources to be used.
 - 
getKendrapublic com.amazonaws.services.kendra.AWSkendra getKendra() 
 - 
setKendrapublic void setKendra(com.amazonaws.services.kendra.AWSkendra kendra) 
 - 
buildClientprotected com.amazonaws.services.kendra.AWSkendra buildClient() 
 - 
getIndexNamepublic java.lang.String getIndexName() 
 - 
getDataSourceNamepublic java.lang.String getDataSourceName() 
 
- 
 
-