Package io.goobi.viewer.model.search
Interface SearchInterface
- All Known Implementing Classes:
QueryListFunctionality,SearchBean,SearchFunctionality
public interface SearchInterface
Interface that all classes must implement that may be used in jsf search masks
SearchBean is the default
implementation.- Author:
- Florian Alpers
-
Method Summary
Modifier and TypeMethodDescriptionautocomplete(String suggestion) Returns suggestions for autocomplete.Action to execute to change the sort order of hits.intGet the currently active search type.intReturns the current result list page number.Returns the current search filter as string.Returns the base url of the current search page, without any search parameters.Gets the actual search string.List all currentSearchFacets.longGet total number of hits of the last search.intReturns the last result list page number.Gets a list of all available search filters.Gets the current search string for display.Returns the search string for the selected sort option.booleanbooleanChecks if a search has been triggered by the user and not yet been reset.booleanReturns if search is performed only within a DC.booleanisSearchInFacetFieldFlag(String fieldName) Returns if search is performed only within a certain facet field.booleanChecks if a search has been performed and any results are to be excepted (provided the search yielded any).Resets the current search including all results and search parameters.Perform an advanced Search.Perform a simple Search.voidsetActiveContext(String activeContext) voidsetActiveSearchType(int type) Set the search type to use.voidsetCurrentSearchFilterString(String filter) Sets the current search filter as string.voidsetSearchString(String searchString) Sets the actual search string.voidsetSortString(String sortString) Sets the sorting search string.
-
Method Details
-
searchSimple
String searchSimple()Perform a simple Search.- Returns:
- the url to navigate to, or an empty string if naviation is handled internally
-
searchAdvanced
String searchAdvanced()Perform an advanced Search.- Returns:
- the url to navigate to, or an empty string if naviation is handled internally
-
resetSearch
String resetSearch()Resets the current search including all results and search parameters.- Returns:
- the url to navigate to, or an empty string if naviation is handled internally
-
getCurrentPage
int getCurrentPage()Returns the current result list page number.- Returns:
- the current result list page number
-
getLastPage
int getLastPage()Returns the last result list page number.- Returns:
- the last result list page number
-
getActiveContext
String getActiveContext()- Returns:
- The selected result group name or advanced search template
-
setActiveContext
- Parameters:
activeContext- result group name or advanced search template to activate
-
getSortString
String getSortString()Returns the search string for the selected sort option.- Returns:
- the search string for the selected sort option
-
setSortString
Sets the sorting search string.- Parameters:
sortString- sort field and direction encoded as search string
-
isSearchInDcFlag
boolean isSearchInDcFlag()Returns if search is performed only within a DC.- Returns:
- true if the search is restricted to a specific DC (collection) field, false otherwise
-
isSearchInFacetFieldFlag
Returns if search is performed only within a certain facet field.- Parameters:
fieldName- Solr facet field name to check- Returns:
- true if the search is restricted to the given facet field, false otherwise
-
getFacets
SearchFacets getFacets()List all currentSearchFacets.- Returns:
- all current
SearchFacets
-
autocomplete
Returns suggestions for autocomplete.- Parameters:
suggestion- partial input string to complete- Returns:
- suggestions for autocomplete
- Throws:
IndexUnreachableException- if any.
-
getSearchString
String getSearchString()Gets the current search string for display.- Returns:
- the current search string for display
-
getExactSearchString
String getExactSearchString()Gets the actual search string.- Returns:
- the actual search string
-
setSearchString
Sets the actual search string.- Parameters:
searchString- raw search query to set
-
getSearchFilters
List<SearchFilter> getSearchFilters()Gets a list of all available search filters.- Returns:
- a list of all available search filters
-
getCurrentSearchFilterString
String getCurrentSearchFilterString()Returns the current search filter as string.- Returns:
- the current search filter as string
-
setCurrentSearchFilterString
Sets the current search filter as string.- Parameters:
filter- search filter identifier string to activate
-
getActiveSearchType
int getActiveSearchType()Get the currently active search type. The possible types are defined inSearchHelper- Returns:
- the active search type
-
setActiveSearchType
void setActiveSearchType(int type) Set the search type to use. The possible types are defined inSearchHelper- Parameters:
type- search type constant as defined in SearchHelper
-
isSearchPerformed
boolean isSearchPerformed()Checks if a search has been performed and any results are to be excepted (provided the search yielded any).- Returns:
- whether a search has been performed after the last reset
-
isExplicitSearchPerformed
boolean isExplicitSearchPerformed()Checks if a search has been triggered by the user and not yet been reset.- Returns:
- if a search has been triggered by the user and not yet been reset
-
getHitsCount
long getHitsCount()Get total number of hits of the last search.- Returns:
- the total number of hits of the last search
-
changeSorting
Action to execute to change the sort order of hits.- Returns:
- Navigation outcome
- Throws:
IOException
-
getCurrentSearchUrlRoot
String getCurrentSearchUrlRoot()Returns the base url of the current search page, without any search parameters.- Returns:
- the base url of the current search page, without any search parameters
-
hasGeoLocationHits
boolean hasGeoLocationHits() -
getHitsMap
GeoMap getHitsMap()
-