Class IIIFSearchBuilder
java.lang.Object
io.goobi.viewer.model.iiif.search.IIIFSearchBuilder
Creates a IIIF Search API v1.0 response as
SearchResult
- Author:
- florian
-
Constructor Summary
ConstructorDescriptionIIIFSearchBuilder
(AbstractApiUrlManager urls, String query, String pi, javax.servlet.http.HttpServletRequest request) Initializes the builder with all required parameters -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.iiif.search.SearchResult
build()
de.intranda.api.iiif.search.AutoSuggestResult
getDate()
Getter for the fielddate
.int
Getter for the fieldhitsPerPage
.getMin()
Getter for the fieldmin
.Getter for the fieldmotivation
.int
getPage()
Getter for the fieldpage
.getPi()
Getter for the fieldpi
.getQuery()
Getter for the fieldquery
.getUser()
Getter for the fielduser
.Setter for the fielddate
.setHitsPerPage
(int hitsPerPage) Setter for the fieldhitsPerPage
.Setter for the fieldmin
.setMotivation
(String motivation) Setter for the fieldmotivation
.Setter for the fieldpage
.Setter for the fielduser
.
-
Constructor Details
-
IIIFSearchBuilder
public IIIFSearchBuilder(AbstractApiUrlManager urls, String query, String pi, javax.servlet.http.HttpServletRequest request) Initializes the builder with all required parameters- Parameters:
urls
-query
- the query stringpi
- the pi of the manifest to searchrequest
-
-
-
Method Details
-
getQuery
Getter for the field
query
.- Returns:
- the query
-
getPi
Getter for the field
pi
.- Returns:
- the pi
-
setMotivation
Setter for the field
motivation
.- Parameters:
motivation
- the motivation to set- Returns:
- a
IIIFSearchBuilder
object.
-
getMotivation
Getter for the field
motivation
.- Returns:
- the motivation
-
getMotivationAsString
-
setUser
Setter for the field
user
.- Parameters:
user
- the user to set- Returns:
- a
IIIFSearchBuilder
object.
-
getUser
Getter for the field
user
.- Returns:
- the user
-
setDate
Setter for the field
date
.- Parameters:
date
- the date to set- Returns:
- a
IIIFSearchBuilder
object.
-
getDate
Getter for the field
date
.- Returns:
- the date
-
getMin
Getter for the field
min
.- Returns:
- the min
-
setMin
Setter for the field
min
.- Parameters:
min
- the min to set- Returns:
- a
IIIFSearchBuilder
object.
-
setPage
Setter for the field
page
.- Parameters:
page
- the page to set- Returns:
- a
IIIFSearchBuilder
object.
-
getPage
public int getPage()Getter for the field
page
.- Returns:
- the page
-
getHitsPerPage
public int getHitsPerPage()Getter for the field
hitsPerPage
.- Returns:
- the hitsPerPage
-
setHitsPerPage
Setter for the field
hitsPerPage
.- Parameters:
hitsPerPage
- the hitsPerPage to set- Returns:
- a
IIIFSearchBuilder
object.
-
build
public de.intranda.api.iiif.search.SearchResult build() throws PresentationException, IndexUnreachableExceptionCreates aSearchResult
containing annotations matchinggetQuery()
withingetPi()
. The answer may contain more thangetHitsPerPage()
hits if more than one motivation is searched, but no more thangetHitsPerPage()
hits per motivation.- Returns:
- the search result
- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
buildAutoSuggest
public de.intranda.api.iiif.search.AutoSuggestResult buildAutoSuggest() throws PresentationException, IndexUnreachableException- Returns:
- The searchTerm list
- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-