Content

Retrieves content from the dotCMS repository

Abstracts the generation of the required Lucene query to look for user searchable fields in a Content Type, and returns the expected results. Payload info:

PropertyTypeDescription
globalSearchStringGlobal search term (like the main search box)
searchableFieldsByContentTypeObjectContent-type specific field searches. Value object consists of content type variables as keys, and objects as values, the latter consisting of the system variables of fields as keys, and query strings as values. See table below for how to interact with different field types, and the example request for how to structure the payload.
systemSearchableFieldsObjectSystem-level filters: siteid, languageId, folderId, workflowSchemeId, workflowStepId, and variantName (defaults to "DEFAULT"). systemHostContent determines whether to include content from the SYSTEM_HOST (defaults to "true").
archivedContentBoolean StringInclude archived content ("true"/"false")
unpublishedContentBoolean StringInclude unpublished content ("true"/"false")
lockedContentBoolean StringInclude locked content ("true"/"false")
orderByStringSort criteria (defaults to "score,modDate desc")
pageIntegerPage number for pagination
perPageIntegerResults per page

When using searchableFieldsByContentType, different fields may require different string types:

Field TypeDescription
title, textArea, wysiwygText search
categoryComma-separated category IDs
checkbox, multiSelectComma-separated values (not labels)
radio, selectValues (not labels)
date, dateAndTimeDate or range: "2023-01-01 TO 2023-12-31"
timeTime or range with TO
tagComma-separated tag names
relationshipsChild contentlet ID
json, keyValueMatches any string in JSON
binary, blockEditor, customText search
post/api/v1/content/search

Request body

globalSearchstring
systemSearchableFieldsobject
archivedContentstring
unpublishedContentstring
lockedContentstring
orderBystring
pageinteger
perPageinteger
searchableFieldsByContentTypeobject

Response

The query has been executed. It's possible that no contents matched the search criteria.

resultsSizeinteger
queryTookinteger
contentTookinteger

Changes

No recorded changes to this endpoint across all 1 revision of this API.