Class Search
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSearch()Empty constructor for JPA.Search(int searchType, SearchFilter searchFilter, List<SearchResultGroup> resultGroups) Constructor for Search.Search(int searchType, SearchFilter searchFilter, List<SearchResultGroup> resultGroups, List<String> facetFields) Constructor for Search.cloning constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidexecute.voidexecute(SearchFacets facets, Map<String, Set<String>> searchTerms, int hitsPerPage, Locale locale, boolean keepSolrDoc, SearchAggregationType aggregationType) execute.generateFinalSolrQuery(SearchFacets facets) generateFinalSolrQuery(SearchFacets facets, SearchAggregationType aggregationType) Returns a list of currently selected sort fields with any configured static sort fields.Getter for the fielddateUpdated.Getter for the fieldexpandQuery.Getter for the fieldfacetString.getHits()Getter for the fieldhits.longGetter for the fieldhitsCount.getId()Getter for the fieldid.longGetter for the fieldlastHitsCount.intgetLastPage(int hitsPerPage) getLastPage.getName()Getter for the fieldname.getOwner()Getter for the fieldowner.intgetPage()Getter for the fieldpage.protected static double[][]intgetQuery()Getter for the fieldquery.Getter for the fieldsearchFilter.intGetter for the fieldsearchType.Getter for the fieldsortFields.Getter for the fieldsortString.getUrl()Constructs a search URL using the query parameters contained in this object.Getter for the fielduserInput.inthashCode()booleanbooleanbooleanisNewHitsNotification.booleanisSaved()isSaved.protected static double[]parsePoint(Object x, Object y) voidsetCustomFilterQuery(String customFilterQuery) voidsetDateUpdated(LocalDateTime dateUpdated) Setter for the fielddateUpdated.voidsetExpandQuery(String expandQuery) Setter for the fieldexpandQuery.voidsetFacetString(String facetString) Setter for the fieldfacetString.voidsetHitsCount(long hitsCount) Setter for the fieldhitsCount.voidSetter for the fieldid.voidsetLastHitsCount(long lastHitsCount) Setter for the fieldlastHitsCount.voidsetMetadataListType(String metadataListType) voidSetter for the fieldname.voidsetNewHitsNotification(boolean newHitsNotification) Setter for the fieldnewHitsNotification.voidSetter for the fieldowner.voidsetPage(int page) Setter for the fieldpage.voidsetProximitySearchDistance(int proximitySearchDistance) voidSetter for the fieldquery.voidsetResultGroups(List<SearchResultGroup> resultGroups) voidsetSaved(boolean saved) Setter for the fieldsaved.voidsetSearchFilter(String searchFilter) Setter for the fieldsearchFilter.voidvoidsetSearchType(int searchType) Setter for the fieldsearchType.voidsetSortString(String sortString) Setter for the fieldsortString.voidsetUserInput(String userInput) Setter for the fielduserInput.voidToggles the status of newHitsNotification and persists this search.
-
Constructor Details
-
Search
public Search()Empty constructor for JPA. -
Search
cloning constructor. Creates a new search in a state as it might be loaded from database, i.e. without any transient fields set. In particular with emptygetHits()- Parameters:
blueprint-
-
Search
Constructor for Search.
- Parameters:
searchType- a int.searchFilter- aSearchFilterobject.resultGroups-
-
Search
public Search(int searchType, SearchFilter searchFilter, List<SearchResultGroup> resultGroups, List<String> facetFields) Constructor for Search.
- Parameters:
searchType- a int.searchFilter- aSearchFilterobject.resultGroups- theSearchResultGroups to searchfacetFields- the facet fields to use
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
generateFinalSolrQuery
- Parameters:
facets-- Returns:
- Generated Solr query
- Throws:
IndexUnreachableException
-
generateFinalSolrQuery
- Parameters:
facets-aggregationType-- Returns:
- Generated Solr query
- Throws:
IndexUnreachableException
-
execute
public void execute(SearchFacets facets, Map<String, Set<String>> searchTerms, int hitsPerPage, Locale locale) throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationExceptionexecute.
- Parameters:
facets- aSearchFacetsobject.searchTerms- aMapobject.hitsPerPage- a int.locale- Selected locale- Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.ViewerConfigurationException- if any.
-
execute
public void execute(SearchFacets facets, Map<String, Set<String>> searchTerms, int hitsPerPage, Locale locale, boolean keepSolrDoc, SearchAggregationType aggregationType) throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationExceptionexecute.
- Parameters:
facets- aSearchFacetsobject.searchTerms- aMapobject.hitsPerPage- a int.locale- Selected localekeepSolrDoc-aggregationType-- Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.ViewerConfigurationException- if any.
-
getLocations
- Parameters:
o-- Returns:
- List
-
getPoints
- Parameters:
value-- Returns:
- double[][]
-
parsePoint
- Parameters:
x-y-- Returns:
- double[][]
-
getUrl
Constructs a search URL using the query parameters contained in this object.- Returns:
- a
Stringobject. - Throws:
UnsupportedEncodingException- if any.
-
getId
Getter for the field
id.- Returns:
- the id
-
setId
Setter for the field
id.- Parameters:
id- the id to set
-
getOwner
Getter for the field
owner.- Returns:
- the owner
-
setOwner
Setter for the field
owner.- Parameters:
owner- the owner to set
-
getName
Getter for the field
name.- Returns:
- the name
-
setName
Setter for the field
name.- Parameters:
name- the name to set
-
getUserInput
Getter for the field
userInput.- Returns:
- the userInput
-
setUserInput
Setter for the field
userInput.- Parameters:
userInput- the userInput to set
-
getSearchType
public int getSearchType()Getter for the field
searchType.- Returns:
- the searchType
-
setSearchType
public void setSearchType(int searchType) Setter for the field
searchType.- Parameters:
searchType- the searchType to set
-
getSearchFilter
Getter for the field
searchFilter.- Returns:
- the searchFilter
-
setSearchFilter
Setter for the field
searchFilter.- Parameters:
searchFilter- the searchFilter to set
-
getQuery
Getter for the field
query.- Returns:
- the query
-
setQuery
Setter for the field
query.- Parameters:
query- the query to set
-
getExpandQuery
Getter for the field
expandQuery.- Returns:
- the expandQuery
-
setExpandQuery
Setter for the field
expandQuery.- Parameters:
expandQuery- the expandQuery to set
-
getCustomFilterQuery
- Returns:
- the customFilterQuery
-
setCustomFilterQuery
- Parameters:
customFilterQuery- the customFilterQuery to set
-
getPage
public int getPage()Getter for the field
page.- Returns:
- the page
-
setPage
public void setPage(int page) Setter for the field
page.- Parameters:
page- the page to set
-
getFacetString
Getter for the field
facetString.- Returns:
- the facetString
-
setFacetString
Setter for the field
facetString.- Parameters:
facetString- the facetString to set
-
getSortString
Getter for the field
sortString.- Returns:
- the sortString
-
setSortString
Setter for the field
sortString.- Parameters:
sortString- the sortString to set
-
getSearchSortingOption
- Returns:
SearchSortingOption
-
setSearchSortingOption
- Parameters:
option-
-
getAllSortFields
Returns a list of currently selected sort fields with any configured static sort fields.- Returns:
- A list of both static and selected fields
-
getSortFields
Getter for the field
sortFields.- Returns:
- the sortFields
-
getDateUpdated
Getter for the field
dateUpdated.- Returns:
- the dateUpdated
-
setDateUpdated
Setter for the field
dateUpdated.- Parameters:
dateUpdated- the dateUpdated to set
-
getLastHitsCount
public long getLastHitsCount()Getter for the field
lastHitsCount.- Returns:
- the lastHitsCount
-
setLastHitsCount
public void setLastHitsCount(long lastHitsCount) Setter for the field
lastHitsCount.- Parameters:
lastHitsCount- the lastHitsCount to set
-
isNewHitsNotification
public boolean isNewHitsNotification()isNewHitsNotification.
- Returns:
- the newHitsNotification
-
setNewHitsNotification
public void setNewHitsNotification(boolean newHitsNotification) Setter for the field
newHitsNotification.- Parameters:
newHitsNotification- the newHitsNotification to set
-
getProximitySearchDistance
public int getProximitySearchDistance()- Returns:
- the proximitySearchDistance
-
setProximitySearchDistance
public void setProximitySearchDistance(int proximitySearchDistance) - Parameters:
proximitySearchDistance- the proximitySearchDistance to set
-
getResultGroups
- Returns:
- the resultGroups
-
setResultGroups
- Parameters:
resultGroups- the resultGroups to set
-
isSaved
public boolean isSaved()isSaved.
- Returns:
- the saved
-
setSaved
public void setSaved(boolean saved) Setter for the field
saved.- Parameters:
saved- the saved to set
-
getHitsCount
public long getHitsCount()Getter for the field
hitsCount.- Returns:
- the hitsCount
-
setHitsCount
public void setHitsCount(long hitsCount) Setter for the field
hitsCount.- Parameters:
hitsCount- the hitsCount to set
-
getHits
Getter for the field
hits.- Returns:
- the hits
-
getLastPage
public int getLastPage(int hitsPerPage) getLastPage.
- Parameters:
hitsPerPage- a int.- Returns:
- a int.
-
toggleNotifications
Toggles the status of newHitsNotification and persists this search.- Throws:
DAOException- if any.
-
getHitsLocationList
- Returns:
- the hitGeoCoordinateList
-
isHasGeoLocationHits
public boolean isHasGeoLocationHits()- Returns:
- the hasGeoLocationHits
-
isGroupPreviewMode
public boolean isGroupPreviewMode()- Returns:
- true if resultGroups larger than 1; false otherwise
-
getMetadataListType
- Returns:
- the metadataListType
-
setMetadataListType
- Parameters:
metadataListType- the metadataListType to set
-
getFacetFields
-