REST - Document - Search

REST-Interface

Search documents by query

URL GET <application-url>/api/document/search

Query parameter

  • query mandatory: true url encoded search query
  • languageKey possible: de, en, fr, it, … default: de language key
  • categoryIdsAnd category-filter (and-related) (multiple), i.e.: “&categoryIdsAnd=1&categoryIdsAnd=2&categoryIdsAnd=3”
  • categoryIdsOr category-filter (or-related) (multiple), i.e.: “&categoryIdsOr=1&categoryIdsOr=2&categoryIdsOr=3”
  • roleRightRoleId Id of a related role (workgroup or personal role).
  • roleRightType Type of a related roleRight (1 - READ, 2 EDIT). Should normally be used with roleRightRoleId.
  • read true - only read documents false - only unread documents unreadSinceAccountCreation - only unread docs since first login unreadSinceLastLogin - only unread docs since last login
  • showBios true - get also bio-documents
  • showTemplates true - get also templates
  • showArchived true - get also archived docs
  • showRemoved true - get also removed docs
  • showBiosOnly true - get only bio-documents
  • showTemplatesOnly true - get only templates
  • showArchivedOnly true - get only archived docs
  • showRemovedOnly true - get only removed docs
  • followerAccountId documents, the given account id follow. this will be OR-related with “categoryfolloweraccountid”, if both are given.
  • following if true, currently logged-in account follows documents
  • markedHelpfulByContactId id of a contact that marked the document-language-version as helpful
  • lastChangedSinceDays possible: 0, 1, 2, … last changed within the last count of days
  • lastChangedSince last changed since “timestamp” in seconds, i.e. 1451904693
  • responsibleContactId contact-id of a responsible
  • responsible if true, currently logged-in account is responsible of documents
  • authorshipAccountId account-id of an “author” (stored in WriteRelation-Table)
  • authorship if true, currently logged-in account is author of documents possible: true, false review for document is requested
  • showLanguageVersionReviewedOnly possible: true, false default: false show only reviewed documents. document is “reviewed” (status-bit REVIEWED (4) is set)
  • hideLanguageVersionReviewed possible: true, false default: false hide reviewed documents document is not “reviewed” (status-bit REVIEWED (4) is not set)
  • showLanguageVersionReadyOnly possible: true, false default: false show only published documents. document is “ready” (status-bit READY (1) is set)
  • hideLanguageVersionReady possible: true, false default: false hide published documents document is not “ready” (status-bit READY (1) is not set)
  • showLanguageVersionCurrentlyInProcessingOnly possible: true, false default: false show only documents that are currently in processing. document is “currently in processing” (status-bit CURRENTLY_IN_PROCESSING (2) is set)
  • hideLanguageVersionCurrentlyInProcessing possible: true, false default: false hide documents, that are currently in processing. document is not “currently in processing” (status-bit CURRENTLY_IN_PROCESSING (2) is not set)
  • showLanguageVersionReviewRequestedOnly possible: true, false default: false show only review requested documents
  • hideLanguageVersionReviewRequested possible: true, false default: false review for document is not requested
  • additionalPropertyId possible: 1, 2, 3, 4, 5, … id of an additional-property
  • additionalPropertyType possible: 1, 2, 3, 4 type of an additional-property 1 - NEWS 2 - URGENT 3 - HELP_SECTION_DASHBOARD 4 - HELP_SECTION_DOCUMENT_EDITOR
  • showSnapOnly possible: true, false default: false show only documents with related open snap-task.
  • hideSnap possible: true, false default: false hide documents with related open snap-task.
  • orderBy possible: createTimeInSeconds - document-createtime languageVersionTitle - version-title languageVersionLastChangeInSeconds - version-lastchange sumRating - version-rating the order by
  • orderDir possible: asc, desc default: asc the ordering direction
  • offset
  • limit
  • categoryAggregations possible: true, false default: false whether to build category aggregations or not
  • languageAggregations possible: true, false default: false whether to build language aggregations or not
  • lastChangeAggregations possible: true, false default: false whether to build lastChange aggregations or not
  • highlightField field(s) in which to apply highlighting (multiple), i.e.: “&highlightField=field1&highlightField=field2”
  • includePersons possible: true, false default: false wether or not to include persons in the search result

Produces

application/json
application/xml

com.matterial.mtr.api.object.SearchResult<Document>

  • 200 OK
  • 400 BAD_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/search?query=markdown&languageKey=de


Reindex all documents

Clears the document-part of the index and reindexes all documents for the current instance. URL PUT/POST <application-url>/api/document/search/reindexall

  • 202 ACCEPTED
  • 500 INTERNAL_SERVER_ERROR

Permission ADMINISTRATE_ALL

Sample PUT http://localhost:8080/mtr-backend/api/document/search/reindexall


Search autocomplete

URL GET <application-url>/api/document/search/autocomplete

Query parameter

  • query mandatory: true url encoded search query
  • languageKey possible: de, en, fr, it, … default: de language key
  • categoryIdsAnd category-filter (and-related) (multiple), i.e.: “&categoryIdsAnd=1&categoryIdsAnd=2&categoryIdsAnd=3”
  • categoryIdsOr category-filter (or-related) (multiple), i.e.: “&categoryIdsOr=1&categoryIdsOr=2&categoryIdsOr=3”
  • followerAccountId documents, the given account id follow. this will be OR-related with “categoryfolloweraccountid”, if both are given.
  • markedHelpfulByContactId id of a contact that marked the document-language-version as helpful
  • authorshipAccountId account-id of an “author” (stored in WriteRelation-Table)
  • includePersons possible: true, false default: false wether or not to include persons in the search result

Produces

application/json
application/xml

List<com.matterial.mtr.api.object.SearchAutocompleteSuggest>

  • 200 OK
  • 400 BAR_REQUEST
  • 500 INTERNAL_SERVER_ERROR

Permission Login

Sample GET http://localhost:8080/mtr-backend/api/document/search/autocomplete


Index document

Reindexes one document by id. URL PUT/POST <application-url>/api/document/search/index/<documentId>

Path parameter

  • documentId

Produces

  • 202 ACCEPTED
  • 500 INTERNAL_SERVER_ERROR

Permission ADMINISTRATE_ALL

Sample PUT http://localhost:8080/mtr-backend/api/document/search/index/5


Index document-language-version

Reindexes one document by language-version-id. URL PUT/POST <application-url>/api/document/search/index/<documentId>/version/<documentLanguageVersionId>

Path parameter

  • documentId
  • documentLanguageVersionId

Produces

  • 202 ACCEPTED
  • 500 INTERNAL_SERVER_ERROR

Permission ADMINISTRATE_ALL

Sample PUT http://localhost:8080/mtr-backend/api/document/search/index/5/version/32

×