mirror of
https://github.com/sismics/docs.git
synced 2026-01-20 04:05:40 +00:00
Finding several documents by their title in a single query (#696)
This commit is contained in:
@@ -495,7 +495,36 @@ public class DocumentResource extends BaseResource {
|
||||
|
||||
return Response.ok().entity(response.build()).build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns all documents.
|
||||
*
|
||||
* @api {post} /document/list Get documents
|
||||
* @apiDescription Get documents exposed as a POST endpoint to allow longer search parameters, see the GET endpoint for the API info
|
||||
* @apiName PostDocumentList
|
||||
* @apiGroup Document
|
||||
* @apiVersion 1.12.0
|
||||
*
|
||||
* @param limit Page limit
|
||||
* @param offset Page offset
|
||||
* @param sortColumn Sort column
|
||||
* @param asc Sorting
|
||||
* @param search Search query
|
||||
* @param files Files list
|
||||
* @return Response
|
||||
*/
|
||||
@POST
|
||||
@Path("list")
|
||||
public Response listPost(
|
||||
@FormParam("limit") Integer limit,
|
||||
@FormParam("offset") Integer offset,
|
||||
@FormParam("sort_column") Integer sortColumn,
|
||||
@FormParam("asc") Boolean asc,
|
||||
@FormParam("search") String search,
|
||||
@FormParam("files") Boolean files) {
|
||||
return list(limit, offset, sortColumn, asc, search, files);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a query according to the specified syntax, eg.:
|
||||
* tag:assurance tag:other before:2012 after:2011-09 shared:yes lang:fra thing
|
||||
@@ -663,7 +692,7 @@ public class DocumentResource extends BaseResource {
|
||||
break;
|
||||
case "title":
|
||||
// New title criteria
|
||||
documentCriteria.setTitle(paramValue);
|
||||
documentCriteria.getTitleList().add(paramValue);
|
||||
break;
|
||||
default:
|
||||
fullQuery.add(criteria);
|
||||
|
||||
@@ -77,10 +77,10 @@ If a search `VALUE` is considered invalid, the search result will be empty.
|
||||
* `mime:VALUE`: the document must be of the specified mime type (example: `image/png`)
|
||||
* Shared
|
||||
* `shared:VALUE`: if `VALUE` is `yes`the document must be shared, for other `VALUE`s the criteria is ignored
|
||||
* Tags
|
||||
* Tags: several `tags` or `!tag:` can be specified and the document must match all filters
|
||||
* `tag:VALUE`: the document must contain a tag or a child of a tag that starts with `VALUE`, case is ignored
|
||||
* `!tag:VALUE`: the document must not contain a tag or a child of a tag that starts with `VALUE`, case is ignored
|
||||
* Title
|
||||
* Titles: several `title` can be specified, and the document must match any of the titles
|
||||
* `title:VALUE`: the title of the document must be `VALUE`
|
||||
* User
|
||||
* `by:VALUE`: the document creator's username must be `VALUE` with an exact match, the user must not be deleted
|
||||
|
||||
Reference in New Issue
Block a user