Class SearchResultResource
java.lang.Object
io.goobi.viewer.api.rest.v1.search.SearchResultResource
REST resource for exporting search results in OpenSearch and RIS bibliographic formats.
-
Constructor Summary
ConstructorsConstructorDescriptionSearchResultResource(HttpServletRequest servletRequest, HttpServletResponse servletResponse) -
Method Summary
Modifier and TypeMethodDescriptiongetRISAsFile(String query, String sortString, String activeFacetString, int proximitySearchDistance) getSearchResultsAsFormat(String format, String query, String sortString, String activeFacetString, int proximitySearchDistance, int rows, String identifier) Generic, config-driven export endpoint for search results.getSearchResultsAsXml(String query, String activeFacetString, int rows) Exports the current search results as raw Solr-style XML.
-
Constructor Details
-
SearchResultResource
public SearchResultResource() -
SearchResultResource
-
-
Method Details
-
getRISAsFile
@GET @Path("/ris") @Produces("text/plain") public Response getRISAsFile(@QueryParam("query") @DefaultValue("") String query, @QueryParam("sortString") @DefaultValue("") String sortString, @QueryParam("activeFacetString") @DefaultValue("") String activeFacetString, @QueryParam("proximitySearchDistance") @DefaultValue("0") int proximitySearchDistance) throws PresentationException, IndexUnreachableException, DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, ViewerConfigurationException - Throws:
PresentationExceptionIndexUnreachableExceptionDAOExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionViewerConfigurationException
-
getSearchResultsAsXml
@GET @Path("/export/xml") @Produces("application/xml") public Response getSearchResultsAsXml(@QueryParam("query") @DefaultValue("*:*") String query, @QueryParam("activeFacetString") @DefaultValue("") String activeFacetString, @QueryParam("rows") @DefaultValue("100") int rows) throws PresentationException, IndexUnreachableException, DAOException Exports the current search results as raw Solr-style XML.- Parameters:
query- the Solr search query stringactiveFacetString- the active facet filter stringrows- maximum number of results to return (default 100)- Returns:
- a
Responsecontaining the Solr XML - Throws:
PresentationException- if the query cannot be parsedIndexUnreachableException- if the Solr index is unreachableDAOException- if license types cannot be loaded for access filtering
-
getSearchResultsAsFormat
@GET @Path("/export/{format}") public Response getSearchResultsAsFormat(@PathParam("format") String format, @QueryParam("query") @DefaultValue("*:*") String query, @QueryParam("sortString") @DefaultValue("") String sortString, @QueryParam("activeFacetString") @DefaultValue("") String activeFacetString, @QueryParam("proximitySearchDistance") @DefaultValue("0") int proximitySearchDistance, @QueryParam("rows") @DefaultValue("100") int rows, @QueryParam("identifier") @DefaultValue("") String identifier) Generic, config-driven export endpoint for search results. Theformatpath parameter is matched against thenameattribute of<format>elements inconfig_viewer.xml. Both XSLT-based formats (ris/endnote/bibtex) and Java field-mapped formats (excel/csv) are served here.Unknown formats return 404, disabled formats return 403. The export runs synchronously on the request thread, consistent with the other export endpoints in this resource (the request filter chain does not support asynchronous processing).
- Parameters:
format- the export format name (e.g. "endnote", "bibtex", "ris", "excel", "csv")query- the Solr search query stringsortString- the sort order string (used by field-mapped formats)activeFacetString- the active facet filter stringproximitySearchDistance- maximum word distance for proximity search (used by field-mapped formats)rows- maximum number of results for XSLT formats (default 100; field-mapped formats always export all hits)- Returns:
- a
Responsewith the export content
-