public class SearchServiceImpl extends SearchService implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
SearchService.| Modifier and Type | Class and Description |
|---|---|
static class |
SearchServiceImpl.SearchSettingsChangedEvent
This event is fired when the changes in search server settings are detected (notification from other cluster nodes).
|
settingsBean| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
static void |
executeURLModificationRules(Hit<?> searchHit,
RenderContext context)
Execute rules on a single search hit object.
|
static void |
executeURLModificationRules(List<? extends Hit> searchHits,
RenderContext context)
Execute rules on the list of hit objects.
|
List<String> |
getAvailableProviders()
Return the list of available provider names
|
SearchProvider |
getCurrentProvider()
Returns an instance of the search provider for handling query requests.
|
protected SearchProvider |
getDefaultSearchProvider() |
static SearchServiceImpl |
getInstance() |
protected SearchProvider |
getProvider(String name)
Returns an instance of the search provider for handling query requests.
|
SearchSettings |
getSettings() |
protected void |
load() |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent evt) |
void |
registerSearchProvider(SearchProvider searchProvider)
Register the given search provider in the available search providers
|
SearchResponse |
search(SearchCriteria criteria,
RenderContext context)
Performs a search using the SearchCriteria object, which is created with using the
Jahia Search Tags or can also be created in Java classes by using the
SearchCriteriaFactory.
|
void |
setDefaultSearchProvider(SearchProvider defaultSearchProvider) |
void |
start() |
void |
stop() |
void |
store(SearchSettings cfg) |
protected void |
store(SearchSettings cfg,
JCRSessionWrapper session) |
Suggestion |
suggest(SearchCriteria originalQuery,
RenderContext context,
int maxTermsToSuggest)
Returns a modified suggestion for the original query based on the spell
checker dictionary.
|
Suggestion |
suggest(String originalQuery,
RenderContext context,
int maxTermsToSuggest)
Returns a modified suggestion for the original query based on the spell
checker dictionary.
|
void |
unregisterSearchProvider(SearchProvider searchProvider)
Unregister the given search provider in the available search providers
|
getSettingsBean, setSettingsBeanpublic SearchSettings getSettings()
public static SearchServiceImpl getInstance()
public SearchResponse search(SearchCriteria criteria, RenderContext context)
SearchServicesearch in class SearchServicecriteria - the passed SearchCriteria object, which includes all search criteriacontext - context object, containing information about current user, locale etc.public void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
throws JahiaException
stop in class JahiaServiceJahiaExceptionpublic Suggestion suggest(SearchCriteria originalQuery, RenderContext context, int maxTermsToSuggest)
SearchServicenull is returned.suggest in class SearchServiceoriginalQuery - original search criteriacontext - context object, containing information about current site, workspace, locale etc.maxTermsToSuggest - the maximum number of terms to be suggestednull
is returned.public Suggestion suggest(String originalQuery, RenderContext context, int maxTermsToSuggest)
SearchServicenull is returned.suggest in class SearchServiceoriginalQuery - original query stringcontext - context object, containing information about current site, workspace, locale etc.maxTermsToSuggest - the maximum number of terms to be suggestednull
is returned.public static void executeURLModificationRules(List<? extends Hit> searchHits, RenderContext context)
searchHits, - list of JCRNodeHit objectscontext, - current rendering contextpublic static void executeURLModificationRules(Hit<?> searchHit, RenderContext context)
searchHit, - JCRNodeHit objectcontext, - current rendering contextpublic SearchProvider getCurrentProvider()
protected SearchProvider getProvider(String name)
public void registerSearchProvider(SearchProvider searchProvider) throws InvalidSearchProviderException
searchProvider - InvalidSearchProviderExceptionpublic void unregisterSearchProvider(SearchProvider searchProvider) throws InvalidSearchProviderException
searchProvider - InvalidSearchProviderExceptionpublic List<String> getAvailableProviders()
protected void load()
public void store(SearchSettings cfg)
protected void store(SearchSettings cfg, JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void onApplicationEvent(org.springframework.context.ApplicationEvent evt)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic void setDefaultSearchProvider(SearchProvider defaultSearchProvider)
protected SearchProvider getDefaultSearchProvider()
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.