Class Search
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorDescriptionSearch()
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 TypeMethodDescriptionboolean
void
execute.void
execute
(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
.long
Getter for the fieldhitsCount
.getId()
Getter for the fieldid
.long
Getter for the fieldlastHitsCount
.int
getLastPage
(int hitsPerPage) getLastPage.getName()
Getter for the fieldname
.getOwner()
Getter for the fieldowner
.int
getPage()
Getter for the fieldpage
.protected static double[][]
int
getQuery()
Getter for the fieldquery
.Getter for the fieldsearchFilter
.int
Getter 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
.int
hashCode()
boolean
boolean
boolean
isNewHitsNotification.boolean
isSaved()
isSaved.protected static double[]
parsePoint
(Object x, Object y) void
setCustomFilterQuery
(String customFilterQuery) void
setDateUpdated
(LocalDateTime dateUpdated) Setter for the fielddateUpdated
.void
setExpandQuery
(String expandQuery) Setter for the fieldexpandQuery
.void
setFacetString
(String facetString) Setter for the fieldfacetString
.void
setHitsCount
(long hitsCount) Setter for the fieldhitsCount
.void
Setter for the fieldid
.void
setLastHitsCount
(long lastHitsCount) Setter for the fieldlastHitsCount
.void
setMetadataListType
(String metadataListType) void
Setter for the fieldname
.void
setNewHitsNotification
(boolean newHitsNotification) Setter for the fieldnewHitsNotification
.void
Setter for the fieldowner
.void
setPage
(int page) Setter for the fieldpage
.void
setProximitySearchDistance
(int proximitySearchDistance) void
Setter for the fieldquery
.void
setResultGroups
(List<SearchResultGroup> resultGroups) void
setSaved
(boolean saved) Setter for the fieldsaved
.void
setSearchFilter
(String searchFilter) Setter for the fieldsearchFilter
.void
void
setSearchType
(int searchType) Setter for the fieldsearchType
.void
setSortString
(String sortString) Setter for the fieldsortString
.void
setUserInput
(String userInput) Setter for the fielduserInput
.void
Toggles 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
- aSearchFilter
object.resultGroups
-
-
Search
public Search(int searchType, SearchFilter searchFilter, List<SearchResultGroup> resultGroups, List<String> facetFields) Constructor for Search.
- Parameters:
searchType
- a int.searchFilter
- aSearchFilter
object.resultGroups
- theSearchResultGroup
s 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
- aSearchFacets
object.searchTerms
- aMap
object.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
- aSearchFacets
object.searchTerms
- aMap
object.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
String
object. - 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
-