Package org.fcrepo.http.api
Class FedoraSearch
- java.lang.Object
-
- org.fcrepo.http.commons.AbstractResource
-
- org.fcrepo.http.api.FedoraBaseResource
-
- org.fcrepo.http.api.FedoraSearch
-
@Scope("request") @Path("/fcr:search") public class FedoraSearch extends FedoraBaseResource
- Since:
- 05/06/20
- Author:
- dbernstein
-
-
Field Summary
-
Fields inherited from class org.fcrepo.http.api.FedoraBaseResource
dbTransactionExecutor, identifierConverter, resourceFactory, resourceHelper, securityContext, servletRequest, txManager
-
Fields inherited from class org.fcrepo.http.commons.AbstractResource
defaultPidMinter, fedoraPropsConfig, headers, pidMinter, uriInfo, versionService
-
-
Constructor Summary
Constructors Constructor Description FedoraSearch()
Default JAX-RS entry point
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
doSearch(List<String> conditions, String fields, int maxResults, int offset, String order, String orderBy, boolean includeTotalResultCount)
Perform simple search on the repositoryprotected static Condition
parse(String expression, HttpIdentifierConverter converter)
Parses the url decoded value of a single parameter passed by the http layer into aCondition
.-
Methods inherited from class org.fcrepo.http.api.FedoraBaseResource
doesResourceExist, doInDbTx, doInDbTxWithRetry, getFedoraResource, getUserPrincipal, identifierConverter, isGhostNode, transaction
-
-
-
-
Constructor Detail
-
FedoraSearch
public FedoraSearch()
Default JAX-RS entry point
-
-
Method Detail
-
doSearch
@GET @Produces({"application/json;qs=1.0","text/plain;charset=utf-8","text/html;charset=utf-8"}) public javax.ws.rs.core.Response doSearch(@QueryParam("condition") List<String> conditions, @QueryParam("fields") String fields, @DefaultValue("100") @QueryParam("max_results") int maxResults, @DefaultValue("0") @QueryParam("offset") int offset, @DefaultValue("asc") @QueryParam("order") String order, @QueryParam("order_by") String orderBy, @DefaultValue("false") @QueryParam("include_total_result_count") boolean includeTotalResultCount)
Perform simple search on the repository- Parameters:
conditions
- The conditions constraining the queryfields
- The fields to return in resultsmaxResults
- The max number of results to returnoffset
- The zero-based offset of the first result to be returnedorder
- The order: ie "asc" or "desc"orderBy
- The field by which to order the resultsincludeTotalResultCount
- A flag for including total result count (false by default)- Returns:
- A response object with the search results
-
parse
protected static Condition parse(String expression, HttpIdentifierConverter converter) throws InvalidConditionExpressionException
Parses the url decoded value of a single parameter passed by the http layer into aCondition
.- Parameters:
expression
- The url decoded value of the condition parameter.- Returns:
- the parsed
Condition
object. - Throws:
InvalidConditionExpressionException
-
-