Class IndexResource
java.lang.Object
io.goobi.viewer.api.rest.v1.index.IndexResource
REST resource providing search, field information, and statistical queries against the Solr index.
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<GeoMapFeature> createFeatures(String query, String coordinateQuery, String labelConfig, String searchScope) getGeoJsonResuls(String solrField, String wktRegion, String filterQuery, String facetQuery, String labelField, String searchScope) getHeatmap(String solrField, String wktRegion, String filterQuery, String facetQuery, Integer gridLevel) getItemMetadataList(String config) getMarkerMetadataList(String config) getStatistics(String query)
-
Constructor Details
-
IndexResource
public IndexResource()
-
-
Method Details
-
getStatistics
@GET @Path("/statistics") @Produces("application/json") public String getStatistics(@QueryParam("query") String query) throws IndexUnreachableException, PresentationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Parameters:
query- optional Solr query to filter counted records- Returns:
- Indexed records statistics as JSON
- Throws:
IndexUnreachableExceptionPresentationExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getRecordsForQuery
@POST @Path("/query") @Consumes("application/json") @Produces("application/json") public String getRecordsForQuery(RecordsRequestParameters params) throws IndexUnreachableException, ViewerConfigurationException, DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Parameters:
params- query parameters including query, sort, facet, and result field configuration- Returns:
- Records as JSON
- Throws:
IndexUnreachableExceptionViewerConfigurationExceptionDAOExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
stream
@POST @Path("/stream") @Consumes("text/plain") @Produces("application/json") public StreamingOutput stream(String expression) - Parameters:
expression- raw Solr streaming expression to execute- Returns:
StreamingOutput
-
getAllIndexFields
@GET @Path("/fields") @Produces("application/json") public List<SolrFieldInfo> getAllIndexFields() throws IOException- Returns:
- List
- Throws:
IOException
-
getHeatmap
@GET @Path("/spatial/heatmap/{solrField}") @Produces("application/json") public String getHeatmap(@PathParam("solrField") String solrField, @QueryParam("region") @DefaultValue("[\"-180 -90\" TO \"180 90\"]") String wktRegion, @QueryParam("query") @DefaultValue("*:*") String filterQuery, @QueryParam("facetQuery") @DefaultValue("") String facetQuery, @QueryParam("gridLevel") Integer gridLevel) throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - Parameters:
solrField- Solr field containing spatial coordinate datawktRegion- WKT coordinate string restricting the search areafilterQuery- additional Solr query to filter resultsfacetQuery- facetting expression applied to heatmap resultsgridLevel- heatmap grid resolution level- Returns:
- Heatmap as
String - Throws:
IOExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
-
getGeoJsonResuls
@GET @Path("/spatial/search/{solrField}") @Produces("application/json") public String getGeoJsonResuls(@PathParam("solrField") String solrField, @QueryParam("region") @DefaultValue("[\"-180 -90\" TO \"180 90\"]") String wktRegion, @QueryParam("query") @DefaultValue("*:*") String filterQuery, @QueryParam("facetQuery") @DefaultValue("") String facetQuery, @QueryParam("labelField") String labelField, @QueryParam("scope") String searchScope) throws IndexUnreachableException, PresentationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - Throws:
IndexUnreachableExceptionPresentationExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
-
createFeatures
protected Collection<GeoMapFeature> createFeatures(String query, String coordinateQuery, String labelConfig, String searchScope) throws PresentationException, IndexUnreachableException -
getMarkerMetadataList
-
getItemMetadataList
-