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 activeFacetString, int rows) Generic export endpoint that transforms search results via a config-driven XSLT stylesheet.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 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 unreachable
-
getSearchResultsAsFormat
@GET @Path("/export/{format}") public Response getSearchResultsAsFormat(@PathParam("format") String format, @QueryParam("query") @DefaultValue("*:*") String query, @QueryParam("activeFacetString") @DefaultValue("") String activeFacetString, @QueryParam("rows") @DefaultValue("100") int rows) throws PresentationException, IndexUnreachableException Generic export endpoint that transforms search results via a config-driven XSLT stylesheet.The
formatpath parameter is matched against thenameattribute of<format>elements inconfig_viewer.xml. If the format is not configured the endpoint returns 404; if it is configured but disabled it returns 403.To add a new export format, simply add a
<format>element to the configuration and drop the XSLT stylesheet into the viewer config directory or the classpath:<format name="marc" enabled="true" xslt="solr2marc.xsl" contentType="application/xml" fileExtension="xml" />- Parameters:
format- the export format name (e.g. "endnote", "bibtex", "ris")query- the Solr search query stringactiveFacetString- the active facet filter stringrows- maximum number of results to return (default 100)- Returns:
- a
Responsewith the transformed content - Throws:
PresentationException- if the query cannot be parsedIndexUnreachableException- if the Solr index is unreachable
-