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
ConstructorsConstructorDescriptionSearchFunctionality(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 hitsintGet the currently active search type.Getter for the fieldbaseUrl.intReturn 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 currentSearchFacetsgetFacetString.getFacettedUrl(String facetString) getFacettedUrl.longget total number of hits of the last searchintgetHitsPerPage.intReturn the last result list page numbergetNewSearchUrl.Getter for the fieldpageFacetString.intgetPageNo.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 numberbooleanbooleanCheck if a search has been triggered by the user and not yet been resetbooleanReturn if search is performed only within a DCbooleanisSearchInFacetFieldFlag(String fieldName) Return if search is performed only within a certain facet fieldbooleanCheck if a search has been performed and any results are to be excepted (provided the search yielded any)voidredirectToSearchUrl(boolean keepUrlParameter) redirectToSearchUrl.removeFacet(String facet) removeFacet.Reset the current search including all results and search parametersvoidsearch.Perform an advanced SearchvoidsearchFacetted.Perform a simple SearchvoidsetActiveContext(String activeContext) voidsetActiveSearchType(int type) Set the search type to use.voidsetCurrentSearchFilterString(String filter) Set the current search filter as stringvoidsetFacetString(String facetString) setFacetString.voidsetPageNo(int pageNo) setPageNo.voidsetQueryString.voidsetSearchString(String searchString) Set the actual search stringvoidsetSortString(String solrSortFields) Set the sorting search string
-
Constructor Details
-
Method Details
-
resetSearch
Reset the current search including all results and search parameters- Specified by:
resetSearchin 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:
searchSimplein interfaceSearchInterface- Returns:
- the url to navigate to, or an empty string if naviation is handled internally
-
searchAdvanced
Perform an advanced Search- Specified by:
searchAdvancedin 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
Stringobject.
-
getUrlSuffix
getUrlSuffix.
- Returns:
- a
Stringobject.
-
getUrlSuffix
The part of the search url after the page number -
setPageNo
public void setPageNo(int pageNo) setPageNo.
- Specified by:
setPageNoin interfaceFunctionality- Parameters:
pageNo- a int.
-
getPageNo
public int getPageNo()getPageNo.
- Specified by:
getPageNoin interfaceFunctionality- Returns:
- a int.
-
getCurrentPage
public int getCurrentPage()Return the current result list page number- Specified by:
getCurrentPagein interfaceSearchInterface- Returns:
- the current result list page number
-
getSearchBean
getSearchBean.
- Returns:
- the searchBean
-
getHitsPerPage
public int getHitsPerPage()getHitsPerPage.
- Returns:
- the hitsPerPage
-
getActiveContext
- Specified by:
getActiveContextin interfaceSearchInterface- Returns:
- The selected result group name or advanced search template
-
setActiveContext
- Specified by:
setActiveContextin interfaceSearchInterface- Parameters:
activeContext- aStringobject.
-
getSortString
Return the search string for the selected sort option- Specified by:
getSortStringin interfaceSearchInterface- Returns:
- the search string for the selected sort option
-
setSortString
Set the sorting search string- Specified by:
setSortStringin interfaceSearchInterface- Parameters:
solrSortFields- aStringobject.
-
getFacetString
getFacetString.
- Returns:
- the facetString
-
setFacetString
setFacetString.
- Parameters:
facetString- the facetString to set
-
getQueryString
getQueryString.
- Returns:
- a
Stringobject.
-
getExactSearchString
Get the actual search string- Specified by:
getExactSearchStringin interfaceSearchInterface- Returns:
- the actual search string
-
setQueryString
setQueryString.
- Parameters:
s- aStringobject.
-
getBaseUrl
Getter for the field
baseUrl.- Returns:
- the baseUrl
-
getPageFacetString
Getter for the field
pageFacetString.- Returns:
- the pageFacetString
-
getNewSearchUrl
getNewSearchUrl.
- Returns:
- a
Stringobject.
-
changeSorting
Description copied from interface:SearchInterfaceaction to execute to change sort sort order of hits- Specified by:
changeSortingin interfaceSearchInterface- Returns:
- Navigation outcome
- Throws:
IOException
-
getSortUrl
getSortUrl.
-
getFacettedUrl
getFacettedUrl.
-
removeFacet
removeFacet.
-
getCurrentPagePath
getCurrentPagePath.
- Returns:
- a
Stringobject.
-
isSearchInDcFlag
public boolean isSearchInDcFlag()Return if search is performed only within a DC- Specified by:
isSearchInDcFlagin interfaceSearchInterface- Returns:
- a boolean.
-
isSearchInFacetFieldFlag
Description copied from interface:SearchInterfaceReturn if search is performed only within a certain facet field- Specified by:
isSearchInFacetFieldFlagin interfaceSearchInterface- Parameters:
fieldName-- Returns:
- a boolean.
-
getFacets
List all currentSearchFacets- Specified by:
getFacetsin interfaceSearchInterface- Returns:
- all current
SearchFacets
-
autocomplete
Return suggestions for autocomplete- Specified by:
autocompletein interfaceSearchInterface- Parameters:
suggestion- aStringobject.- Returns:
- suggestions for autocomplete
- Throws:
IndexUnreachableException- if any.
-
getSearchString
Get the current search string for display- Specified by:
getSearchStringin interfaceSearchInterface- Returns:
- the current search string for display
-
getSearchFilters
Get a list of all available search filters- Specified by:
getSearchFiltersin interfaceSearchInterface- Returns:
- a list of all available search filters
-
getCurrentSearchFilterString
Return the current search filter as string- Specified by:
getCurrentSearchFilterStringin interfaceSearchInterface- Returns:
- the current search filter as string
-
setCurrentSearchFilterString
Set the current search filter as string- Specified by:
setCurrentSearchFilterStringin interfaceSearchInterface- Parameters:
filter- aStringobject.
-
getActiveSearchType
public int getActiveSearchType()Get the currently active search type. The possible types are defined inSearchHelper- Specified by:
getActiveSearchTypein 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:
setActiveSearchTypein interfaceSearchInterface- Parameters:
type- a int.
-
setSearchString
Set the actual search string- Specified by:
setSearchStringin interfaceSearchInterface- Parameters:
searchString- aStringobject.
-
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:
isSearchPerformedin 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:
getHitsCountin 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:
getCurrentSearchUrlRootin 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:
getLastPagein 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:
isExplicitSearchPerformedin interfaceSearchInterface- Returns:
- if a search has been triggered by the user and not yet been reset
-
hasGeoLocationHits
public boolean hasGeoLocationHits()- Specified by:
hasGeoLocationHitsin interfaceSearchInterface
-
getHitsMap
- Specified by:
getHitsMapin interfaceSearchInterface
-