public class SolrSiteIndexer extends AbstractLogEnabled implements SiteIndexer, Serviceable, Contextualizable
SiteIndexer
.Modifier and Type | Field and Description |
---|---|
private Context |
_context |
protected SiteDocumentProviderExtensionPoint |
_siteDocProviderEP
The site document provider handler.
|
protected SiteManager |
_siteManager
The site manager.
|
protected SolrClientProvider |
_solrClientProvider
The Solr client provider
|
protected SolrIndexer |
_solrIndexer
The solr indexer.
|
protected SolrPageIndexer |
_solrPageIndexer
The solr page indexer.
|
ROLE
Constructor and Description |
---|
SolrSiteIndexer() |
Modifier and Type | Method and Description |
---|---|
protected void |
_indexContents(Site site,
String workspaceName,
SolrClient solrClient)
Index the contents of a site.
|
protected void |
_indexResources(Site site,
String workspaceName,
SolrClient solrClient)
Index the resources of a site.
|
private void |
_indexSite(String siteName,
String workspaceName,
SolrClient solrClient,
boolean commitAndOptimize) |
private void |
_indexSitemap(String siteName,
String sitemapName,
String workspaceName,
SolrClient solrClient) |
private void |
_indexSitemaps(Site site,
String workspaceName,
SolrClient solrClient) |
private void |
_unindexSiteDocuments(String siteName,
String workspaceName,
SolrClient solrClient) |
private void |
_unindexSitemapDocuments(String siteName,
String sitemapName,
String workspace,
SolrClient solrClient) |
void |
contextualize(Context context) |
void |
indexSite(Site site)
Index a site in all workspaces
|
void |
indexSite(String siteName)
Index a site in all workspaces
|
void |
indexSite(String siteName,
String workspaceName)
Index a site in a specific workspace.
|
void |
indexSite(String siteName,
String workspaceName,
SolrClient solrClient)
Index a site in a specific workspace.
|
void |
indexSitemap(Sitemap sitemap)
Index a sitemap in all workpaces
|
void |
indexSitemap(String siteName,
String sitemapName)
Index a sitemap in all workpaces
|
void |
indexSitemap(String siteName,
String sitemapName,
String workspaceName)
Index a sitemap in a specific workspace.
|
void |
service(ServiceManager manager) |
void |
unindexSite(String siteName)
Unindex a site in all workspaces
|
void |
unindexSite(String siteName,
String workspaceName)
Unindex a site in a specific workspace.
|
void |
unindexSitemap(String siteName,
String sitemapName)
Unindex a sitemap in all workpaces
|
void |
unindexSitemap(String siteName,
String sitemapName,
String workspaceName)
Unindex a sitemap in a specific workspace.
|
getLogger, setLogger
protected SiteManager _siteManager
protected SolrIndexer _solrIndexer
protected SolrPageIndexer _solrPageIndexer
protected SiteDocumentProviderExtensionPoint _siteDocProviderEP
protected SolrClientProvider _solrClientProvider
public SolrSiteIndexer()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void indexSite(Site site) throws IndexingException
SiteIndexer
indexSite
in interface SiteIndexer
site
- the site to index.IndexingException
- If an error occurs while indexing the site.public void indexSite(String siteName) throws IndexingException
SiteIndexer
indexSite
in interface SiteIndexer
siteName
- the name of the site to index.IndexingException
- If an error occurs while indexing the site.public void indexSite(String siteName, String workspaceName) throws IndexingException
SiteIndexer
indexSite
in interface SiteIndexer
siteName
- the name of the site to index.workspaceName
- The workspace name.IndexingException
- If an error occurs while indexing the site.public void indexSite(String siteName, String workspaceName, SolrClient solrClient) throws IndexingException
SiteIndexer
indexSite
in interface SiteIndexer
siteName
- the name of the site to index.workspaceName
- The workspace name.solrClient
- The solr client to useIndexingException
- If an error occurs while indexing the site.private void _indexSite(String siteName, String workspaceName, SolrClient solrClient, boolean commitAndOptimize) throws IndexingException
IndexingException
public void indexSitemap(Sitemap sitemap) throws IndexingException
SiteIndexer
indexSitemap
in interface SiteIndexer
sitemap
- the sitemap to index.IndexingException
- If an error occurs while indexing the sitemap.public void indexSitemap(String siteName, String sitemapName) throws IndexingException
SiteIndexer
indexSitemap
in interface SiteIndexer
siteName
- the site name.sitemapName
- the name of the sitemap to index.IndexingException
- If an error occurs while indexing the sitemap.public void indexSitemap(String siteName, String sitemapName, String workspaceName) throws IndexingException
SiteIndexer
indexSitemap
in interface SiteIndexer
siteName
- the site name.sitemapName
- the name of the sitemap to index.workspaceName
- The workspace name.IndexingException
- If an error occurs while indexing the sitemap.public void unindexSite(String siteName) throws IndexingException
SiteIndexer
unindexSite
in interface SiteIndexer
siteName
- the name of site to unindex.IndexingException
- If an error occurs while unindexing the site.public void unindexSite(String siteName, String workspaceName) throws IndexingException
SiteIndexer
unindexSite
in interface SiteIndexer
siteName
- the name of site to unindex.workspaceName
- The workspace name.IndexingException
- If an error occurs while unindexing the site.public void unindexSitemap(String siteName, String sitemapName) throws IndexingException
SiteIndexer
unindexSitemap
in interface SiteIndexer
siteName
- the site name.sitemapName
- the name of the sitemap to index.IndexingException
- If an error occurs while unindexing the sitemap.public void unindexSitemap(String siteName, String sitemapName, String workspaceName) throws IndexingException
SiteIndexer
unindexSitemap
in interface SiteIndexer
siteName
- the site name.sitemapName
- the name of the sitemap to index.workspaceName
- The workspace name.IndexingException
- If an error occurs while unindexing the sitemap.private void _indexSitemaps(Site site, String workspaceName, SolrClient solrClient) throws Exception
Exception
private void _indexSitemap(String siteName, String sitemapName, String workspaceName, SolrClient solrClient) throws Exception
Exception
private void _unindexSiteDocuments(String siteName, String workspaceName, SolrClient solrClient) throws SolrServerException, IOException
SolrServerException
IOException
private void _unindexSitemapDocuments(String siteName, String sitemapName, String workspace, SolrClient solrClient) throws SolrServerException, IOException
SolrServerException
IOException
protected void _indexContents(Site site, String workspaceName, SolrClient solrClient) throws Exception
site
- The site to index.workspaceName
- The workspace namesolrClient
- The solr client to useException
- If an error occurs indexing the contents.protected void _indexResources(Site site, String workspaceName, SolrClient solrClient) throws Exception
site
- The site to index.workspaceName
- The workspace namesolrClient
- The solr client to useException
- If an error occurs indexing the resources.