Search content using a search query (POST)
Changed onExecutes a JSON search query against dotCMS content in a portlet context. The request body accepts an Elasticsearch/OpenSearch JSON query. The query is routed through the phase-aware search API, so it targets whichever engine the active OpenSearch migration phase selects (Elasticsearch in phases 0-1, OpenSearch in phases 2-3). Results include the matching contentlets plus the search response metadata under 'esresponse', which retains the legacy Elasticsearch-wire shape (took, hits.total, hits.hits[]._id/._index/._score/._source, aggregations) for backward compatibility, regardless of the engine that served the query.
Request
- Base URLhttps://docs.anzworldline-solutions.com.au
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
Depth of related content to include: 0=identifiers only, 1=related contentlets, 2=related contentlets with their related identifiers, 3=related contentlets with their related contentlets. Omit to exclude relationships.
If true, search only live content; if false, search working content
Admin-only: run the query under the permission context of this user ID or email address
If true, return full category details (key, name, description); if false, return only category names
Request body
Response
Search results returned successfully
Search results containing the matching contentlets and the Elasticsearch-wire response metadata under 'esresponse'
Changes
- info
api operation id
searchPostremoved and replaced withsearchContentByESPost - info
api tag
Elasticsearch Content Searchadded - info
added the new optional
queryrequest parameteruserid - info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the success response with the status
- info