public class JahiaJCRSearchProvider extends Object implements SearchProvider, SearchProvider.SupportsSuggestion
SearchProvider.SupportsSuggestion| Constructor and Description |
|---|
JahiaJCRSearchProvider() |
| Modifier and Type | Method and Description |
|---|---|
javax.jcr.query.Query |
buildQuery(SearchCriteria criteria,
JCRSessionWrapper session)
Creates the
Query instance by converting the provided
SearchCriteria bean into XPath query. |
String |
getName() |
TaggingService |
getTaggingService() |
boolean |
isEnabled()
Checks whether this provider is enabled.
|
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 |
setName(String name) |
void |
setTaggingService(TaggingService taggingService) |
void |
setTypesToHideFromSearchResults(Set<String> typesToHideFromSearchResults) |
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 maxTerms)
Returns a modified suggestion for the original query based on the spell
checker dictionary.
|
Suggestion |
suggest(String originalQuery,
String[] sites,
RenderContext context,
int maxTermsToSuggest) |
public SearchResponse search(SearchCriteria criteria, RenderContext context)
SearchProvidersearch in interface SearchProvidercriteria - the passed SearchCriteria object, which includes all search criteriacontext - context object, containing information about current user, locale etc.public Suggestion suggest(String originalQuery, RenderContext context, int maxTerms)
SearchProvidernull is returned.suggest in interface SearchProvideroriginalQuery - original query stringcontext - context object, containing information about current site, workspace, locale etc.maxTerms - the maximum number of terms to suggestnull
is returned.public Suggestion suggest(SearchCriteria originalQuery, RenderContext context, int maxTermsToSuggest)
SearchProvider.SupportsSuggestionnull is returned.suggest in interface SearchProvider.SupportsSuggestionoriginalQuery - original search criteriacontext - context object, containing information about current site, workspace, locale etc.maxTermsToSuggest - the maximum number of terms to suggestnull
is returned.public Suggestion suggest(String originalQuery, String[] sites, RenderContext context, int maxTermsToSuggest)
public javax.jcr.query.Query buildQuery(SearchCriteria criteria, JCRSessionWrapper session) throws javax.jcr.query.InvalidQueryException, javax.jcr.RepositoryException
Query instance by converting the provided
SearchCriteria bean into XPath query.criteria - the search criteria to use for the querysession - current JCR sessionQuery instance created by converting the provided
SearchCriteria bean into XPath query or null
if the query cannot be createdjavax.jcr.query.InvalidQueryExceptionjavax.jcr.RepositoryException - in case of JCR-related errorspublic TaggingService getTaggingService()
public void setTaggingService(TaggingService taggingService)
public void setTypesToHideFromSearchResults(Set<String> typesToHideFromSearchResults)
public String getName()
getName in interface SearchProviderpublic void setName(String name)
public boolean isEnabled()
SearchProviderisEnabled in interface SearchProvidertrue if the provider is enabled, false otherwise.Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.