Interface OmniSearchHandler
-
- All Known Implementing Classes:
AbstractOmniSearchHandler
@ConsumerType public interface OmniSearchHandler
A service providerOmniSearchHandler
interface i.e. search module Assets, Sites would need to implement this interface. OmniSearch allows different modules to register themselves, by implementing this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getID()
This function returns ID ofSuggestionHandler
aka Search Module This ID helps identify the search module uniquely i.e.Resource
getModuleConfig(ResourceResolver resolver)
Every search module will store additional configuration i.e.java.util.List<PredicateSuggestion>
getPredicateSuggestions(ResourceResolver resolver, I18n i18n, java.lang.String term)
This function provide predicate suggestions for the current search term.SearchResult
getResults(ResourceResolver resolver, java.util.Map<java.lang.String,java.lang.Object> predicateParameters, long limit, long offset)
returns the search results.Query
getSpellCheckQuery(ResourceResolver resolver, java.lang.String searchTerm)
This function return the Spell Check suggestion according to the search term.Query
getSuggestionQuery(ResourceResolver resolver, java.lang.String term)
This function returnsQuery
that provides suggestions query for module
-
-
-
Method Detail
-
getID
java.lang.String getID()
This function returns ID ofSuggestionHandler
aka Search Module This ID helps identify the search module uniquely i.e. assets, sites, projects etc.- Returns:
- ID of
SuggestionHandler
-
getSuggestionQuery
Query getSuggestionQuery(ResourceResolver resolver, java.lang.String term)
This function returnsQuery
that provides suggestions query for module- Parameters:
resolver
- ResourceResolver instanceterm
- text term for which suggestions are require- Returns:
Query
that returns suggestions on execution
-
getPredicateSuggestions
java.util.List<PredicateSuggestion> getPredicateSuggestions(ResourceResolver resolver, I18n i18n, java.lang.String term)
This function provide predicate suggestions for the current search term. Predicates generally have known limited values i.e. File Type predicate may have Images, Documents, Videos as values. So, if search term is "Ima", it should return predicate "File Type: Images"- Parameters:
resolver
- ResourceResolver instancei18n
- I18n instanceterm
- text term for which suggestions are require- Returns:
List
of Predicates
-
getSpellCheckQuery
Query getSpellCheckQuery(ResourceResolver resolver, java.lang.String searchTerm)
This function return the Spell Check suggestion according to the search term. This enables did you mean functionality- Parameters:
resolver
- ResourceResolver instancesearchTerm
- text term for which suggestions are require @returnList
of Predicates- Returns:
- Query
-
getModuleConfig
Resource getModuleConfig(ResourceResolver resolver)
Every search module will store additional configuration i.e.itemCardType
itemListType
to specify configuration that can be used to represent search module resources i.e. assets, sites, users, groups. This api returns such a resource that stores the config. Additionally, this allows ability to control the visibility of particular search module to a user. If a user does not have access to this resource. OmniSearch will not include this search module in its searches i.e. suggestions, search etc.- Parameters:
resolver
- ResourceResolver instance- Returns:
Resource
of content Node
-
getResults
SearchResult getResults(ResourceResolver resolver, java.util.Map<java.lang.String,java.lang.Object> predicateParameters, long limit, long offset)
returns the search results.- Parameters:
resolver
-ResourceResolver
instancepredicateParameters
- search predicate parameter map. Each module is independent to do search based on existing mechanism i.e. Oak Query enginer, QueryBuilder, some other api i.e User Manager search. Map of parameters this should be in format of <String, String> or <String, String[]>limit
- number of result on a pageoffset
- offset/start of result- Returns:
SearchResult
-
-