public class SiteAwareSearchService extends Object implements org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>
SearchService wrapper that forces all operations to use an index ID based on the current site. If a method
is called with no index ID, one is created by appending the current site name + a separator + a default index
suffix. If an index ID is provided, then the actual, final index ID is formed by appending the current site name + a
separator + the provided index ID as a suffix.| Modifier and Type | Field and Description |
|---|---|
protected org.craftercms.search.service.SearchService<org.craftercms.search.service.Query> |
actualSearchService |
static String |
DEFAULT_INDEX_ID_SEPARATOR |
protected String |
defaultIndexIdSuffix |
protected String |
indexIdSeparator |
| Constructor and Description |
|---|
SiteAwareSearchService() |
| Modifier and Type | Method and Description |
|---|---|
void |
commit() |
void |
commit(String indexId) |
org.craftercms.search.service.Query |
createQuery() |
org.craftercms.search.service.Query |
createQuery(Map<String,String[]> params) |
void |
delete(String site,
String id) |
void |
delete(String indexId,
String site,
String id) |
protected String |
getActualIndexId(String indexIdSuffix) |
protected String |
getCurrentSiteName() |
Map<String,Object> |
search(org.craftercms.search.service.Query query) |
Map<String,Object> |
search(String indexId,
org.craftercms.search.service.Query query) |
void |
setActualSearchService(org.craftercms.search.service.SearchService<org.craftercms.search.service.Query> actualSearchService) |
void |
setDefaultIndexIdSuffix(String defaultIndexIdSuffix) |
void |
setIndexIdSeparator(String indexIdSeparator) |
void |
update(String site,
String id,
String xml,
boolean ignoreRootInFieldNames) |
void |
update(String indexId,
String site,
String id,
String xml,
boolean ignoreRootInFieldNames) |
void |
updateContent(String site,
String id,
org.craftercms.core.service.Content content) |
void |
updateContent(String site,
String id,
org.craftercms.core.service.Content content,
Map<String,List<String>> additionalFields) |
void |
updateContent(String site,
String id,
File file) |
void |
updateContent(String site,
String id,
File file,
Map<String,List<String>> additionalFields) |
void |
updateContent(String indexId,
String site,
String id,
org.craftercms.core.service.Content content) |
void |
updateContent(String indexId,
String site,
String id,
org.craftercms.core.service.Content content,
Map<String,List<String>> additionalFields) |
void |
updateContent(String indexId,
String site,
String id,
File file) |
void |
updateContent(String indexId,
String site,
String id,
File file,
Map<String,List<String>> additionalFields) |
public static final String DEFAULT_INDEX_ID_SEPARATOR
protected String defaultIndexIdSuffix
protected String indexIdSeparator
protected org.craftercms.search.service.SearchService<org.craftercms.search.service.Query> actualSearchService
public void setDefaultIndexIdSuffix(String defaultIndexIdSuffix)
public void setIndexIdSeparator(String indexIdSeparator)
public void setActualSearchService(org.craftercms.search.service.SearchService<org.craftercms.search.service.Query> actualSearchService)
public org.craftercms.search.service.Query createQuery()
createQuery in interface org.craftercms.search.service.QueryFactory<org.craftercms.search.service.Query>public org.craftercms.search.service.Query createQuery(Map<String,String[]> params)
createQuery in interface org.craftercms.search.service.QueryFactory<org.craftercms.search.service.Query>public Map<String,Object> search(org.craftercms.search.service.Query query) throws org.craftercms.search.exception.SearchException
search in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic Map<String,Object> search(String indexId, org.craftercms.search.service.Query query) throws org.craftercms.search.exception.SearchException
search in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void update(String site, String id, String xml, boolean ignoreRootInFieldNames) throws org.craftercms.search.exception.SearchException
update in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void update(String indexId, String site, String id, String xml, boolean ignoreRootInFieldNames) throws org.craftercms.search.exception.SearchException
update in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void delete(String site, String id) throws org.craftercms.search.exception.SearchException
delete in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void delete(String indexId, String site, String id) throws org.craftercms.search.exception.SearchException
delete in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String site, String id, File file) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String indexId, String site, String id, File file) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String site, String id, File file, Map<String,List<String>> additionalFields) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String indexId, String site, String id, File file, Map<String,List<String>> additionalFields) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String site, String id, org.craftercms.core.service.Content content) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String indexId, String site, String id, org.craftercms.core.service.Content content) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String site, String id, org.craftercms.core.service.Content content, Map<String,List<String>> additionalFields) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void updateContent(String indexId, String site, String id, org.craftercms.core.service.Content content, Map<String,List<String>> additionalFields) throws org.craftercms.search.exception.SearchException
updateContent in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void commit()
throws org.craftercms.search.exception.SearchException
commit in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionpublic void commit(String indexId) throws org.craftercms.search.exception.SearchException
commit in interface org.craftercms.search.service.SearchService<org.craftercms.search.service.Query>org.craftercms.search.exception.SearchExceptionprotected String getCurrentSiteName()
Copyright © 2018 CrafterCMS. All rights reserved.