Class SearchFunctionality
java.lang.Object
io.goobi.viewer.model.cms.itemfunctionality.SearchFunctionality
- All Implemented Interfaces:
Functionality
,SearchInterface
- Direct Known Subclasses:
QueryListFunctionality
SearchFunctionality class.
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorDescriptionSearchFunctionality
(String pageFacetString, String baseUrl) Constructor for SearchFunctionality. -
Method Summary
Modifier and TypeMethodDescriptionautocomplete
(String suggestion) Return suggestions for autocompleteaction to execute to change sort sort order of hitsint
Get the currently active search type.Getter for the fieldbaseUrl
.int
Return the current result list page numbergetCurrentPagePath.Return the current search filter as stringReturn the base url of the current search page, without any search parametersGet the actual search stringList all currentSearchFacets
getFacetString.getFacettedUrl
(String facetString) getFacettedUrl.long
get total number of hits of the last searchint
getHitsPerPage.int
Return the last result list page numbergetNewSearchUrl.Getter for the fieldpageFacetString
.int
getPageNo.getQueryString.getSearchBean.Get a list of all available search filtersGet the current search string for displayReturn the search string for the selected sort optiongetSortUrl
(String sortString, boolean descending) getSortUrl.The part of the search url before the page numbergetUrlSuffix.getUrlSuffix
(String solrSortFields) The part of the search url after the page numberboolean
boolean
Check if a search has been triggered by the user and not yet been resetboolean
Return if search is performed only within a DCboolean
isSearchInFacetFieldFlag
(String fieldName) Return if search is performed only within a certain facet fieldboolean
Check if a search has been performed and any results are to be excepted (provided the search yielded any)void
redirectToSearchUrl
(boolean keepUrlParameter) redirectToSearchUrl.removeFacet
(String facet) removeFacet.Reset the current search including all results and search parametersvoid
search.Perform an advanced Searchvoid
searchFacetted.Perform a simple Searchvoid
setActiveResultGroupName
(String activeResultGroupName) void
setActiveSearchType
(int type) Set the search type to use.void
setCurrentSearchFilterString
(String filter) Set the current search filter as stringvoid
setFacetString
(String facetString) setFacetString.void
setPageNo
(int pageNo) setPageNo.void
setQueryString.void
setSearchString
(String searchString) Set the actual search stringvoid
setSortString
(String solrSortFields) Set the sorting search string
-
Constructor Details
-
Method Details
-
resetSearch
Reset the current search including all results and search parameters- Specified by:
resetSearch
in interfaceSearchInterface
- Returns:
- the url to navigate to, or an empty string if naviation is handled internally
-
redirectToSearchUrl
public void redirectToSearchUrl(boolean keepUrlParameter) redirectToSearchUrl.
- Parameters:
keepUrlParameter
- a boolean.
-
searchSimple
Perform a simple Search- Specified by:
searchSimple
in interfaceSearchInterface
- Returns:
- the url to navigate to, or an empty string if naviation is handled internally
-
searchAdvanced
Perform an advanced Search- Specified by:
searchAdvanced
in interfaceSearchInterface
- Returns:
- the url to navigate to, or an empty string if naviation is handled internally
-
searchFacetted
public void searchFacetted()searchFacetted.
-
search
public void search(String subtheme) throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationException search.
- Parameters:
subtheme
-- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.DAOException
- if any.ViewerConfigurationException
- if any.
-
getUrlPrefix
The part of the search url before the page number- Returns:
- a
String
object.
-
getUrlSuffix
getUrlSuffix.
- Returns:
- a
String
object.
-
getUrlSuffix
The part of the search url after the page number -
setPageNo
public void setPageNo(int pageNo) setPageNo.
- Specified by:
setPageNo
in interfaceFunctionality
- Parameters:
pageNo
- a int.
-
getPageNo
public int getPageNo()getPageNo.
- Specified by:
getPageNo
in interfaceFunctionality
- Returns:
- a int.
-
getCurrentPage
public int getCurrentPage()Return the current result list page number- Specified by:
getCurrentPage
in interfaceSearchInterface
- Returns:
- the current result list page number
-
getSearchBean
getSearchBean.
- Returns:
- the searchBean
-
getHitsPerPage
public int getHitsPerPage()getHitsPerPage.
- Returns:
- the hitsPerPage
-
getActiveResultGroupName
- Specified by:
getActiveResultGroupName
in interfaceSearchInterface
- Returns:
- The selected result group name
-
setActiveResultGroupName
- Specified by:
setActiveResultGroupName
in interfaceSearchInterface
- Parameters:
activeResultGroupName
- aString
object.
-
getSortString
Return the search string for the selected sort option- Specified by:
getSortString
in interfaceSearchInterface
- Returns:
- the search string for the selected sort option
-
setSortString
Set the sorting search string- Specified by:
setSortString
in interfaceSearchInterface
- Parameters:
solrSortFields
- aString
object.
-
getFacetString
getFacetString.
- Returns:
- the facetString
-
setFacetString
setFacetString.
- Parameters:
facetString
- the facetString to set
-
getQueryString
getQueryString.
- Returns:
- a
String
object.
-
getExactSearchString
Get the actual search string- Specified by:
getExactSearchString
in interfaceSearchInterface
- Returns:
- the actual search string
-
setQueryString
setQueryString.
- Parameters:
s
- aString
object.
-
getBaseUrl
Getter for the field
baseUrl
.- Returns:
- the baseUrl
-
getPageFacetString
Getter for the field
pageFacetString
.- Returns:
- the pageFacetString
-
getNewSearchUrl
getNewSearchUrl.
- Returns:
- a
String
object.
-
changeSorting
Description copied from interface:SearchInterface
action to execute to change sort sort order of hits- Specified by:
changeSorting
in interfaceSearchInterface
- Returns:
- Navigation outcome
- Throws:
IOException
-
getSortUrl
getSortUrl.
-
getFacettedUrl
getFacettedUrl.
-
removeFacet
removeFacet.
-
getCurrentPagePath
getCurrentPagePath.
- Returns:
- a
String
object.
-
isSearchInDcFlag
public boolean isSearchInDcFlag()Return if search is performed only within a DC- Specified by:
isSearchInDcFlag
in interfaceSearchInterface
- Returns:
- a boolean.
-
isSearchInFacetFieldFlag
Description copied from interface:SearchInterface
Return if search is performed only within a certain facet field- Specified by:
isSearchInFacetFieldFlag
in interfaceSearchInterface
- Returns:
- a boolean.
-
getFacets
List all currentSearchFacets
- Specified by:
getFacets
in interfaceSearchInterface
- Returns:
- all current
SearchFacets
-
autocomplete
Return suggestions for autocomplete- Specified by:
autocomplete
in interfaceSearchInterface
- Parameters:
suggestion
- aString
object.- Returns:
- suggestions for autocomplete
- Throws:
IndexUnreachableException
- if any.
-
getSearchString
Get the current search string for display- Specified by:
getSearchString
in interfaceSearchInterface
- Returns:
- the current search string for display
-
getSearchFilters
Get a list of all available search filters- Specified by:
getSearchFilters
in interfaceSearchInterface
- Returns:
- a list of all available search filters
-
getCurrentSearchFilterString
Return the current search filter as string- Specified by:
getCurrentSearchFilterString
in interfaceSearchInterface
- Returns:
- the current search filter as string
-
setCurrentSearchFilterString
Set the current search filter as string- Specified by:
setCurrentSearchFilterString
in interfaceSearchInterface
- Parameters:
filter
- aString
object.
-
getActiveSearchType
public int getActiveSearchType()Get the currently active search type. The possible types are defined inSearchHelper
- Specified by:
getActiveSearchType
in interfaceSearchInterface
- Returns:
- the active search type
-
setActiveSearchType
public void setActiveSearchType(int type) Set the search type to use. The possible types are defined inSearchHelper
- Specified by:
setActiveSearchType
in interfaceSearchInterface
- Parameters:
type
- a int.
-
setSearchString
Set the actual search string- Specified by:
setSearchString
in interfaceSearchInterface
- Parameters:
searchString
- aString
object.
-
isSearchPerformed
public boolean isSearchPerformed()Check if a search has been performed and any results are to be excepted (provided the search yielded any)- Specified by:
isSearchPerformed
in interfaceSearchInterface
- Returns:
- whether a search has been performed after the last reset
-
getHitsCount
public long getHitsCount()get total number of hits of the last search- Specified by:
getHitsCount
in interfaceSearchInterface
- Returns:
- the total number of hits of the last search
-
getCurrentSearchUrlRoot
Return the base url of the current search page, without any search parameters- Specified by:
getCurrentSearchUrlRoot
in interfaceSearchInterface
- Returns:
- the base url of the current search page, without any search parameters
-
getLastPage
public int getLastPage()Return the last result list page number- Specified by:
getLastPage
in interfaceSearchInterface
- Returns:
- the last result list page number
-
isExplicitSearchPerformed
public boolean isExplicitSearchPerformed()Check if a search has been triggered by the user and not yet been reset- Specified by:
isExplicitSearchPerformed
in interfaceSearchInterface
- Returns:
- if a search has been triggered by the user and not yet been reset
-
hasGeoLocationHits
public boolean hasGeoLocationHits()- Specified by:
hasGeoLocationHits
in interfaceSearchInterface
-
getHitsMap
- Specified by:
getHitsMap
in interfaceSearchInterface
-