Content

Search content with Lucene syntax

Changed on

Performs a comprehensive content search using Lucene query syntax. Supports filtering, sorting, pagination, and depth-based relationship loading. Returns structured JSON with search metadata and contentlet results.

Note: This is a wrapper around the former api/content/_search. Both paths remain valid for backwards compatibility, but the v1 path is preferred.

post/api/v1/content/_search

Request

Query parameters

rememberQueryboolean

Store query in session for Query Tool portlet

Request body

querystring

Lucene query. IMPORTANT: custom (user-defined) fields MUST be qualified with the content type's variable name — ContentTypeVar.fieldVar. A BARE field name matches nothing and returns zero results with NO error (a common silent failure). For example, to find featured Books use +AwazonBook.featured:true, not +featured:true; to match a slug use +AwazonBook.slug:my-slug. Restrict the type with +contentType:AwazonBook (contentType is a system field, unqualified).

Results are also HOST-scoped: unless you add a host clause, the search resolves against the current request's site and will NOT return content that lives on a different host (e.g. content saved to SYSTEM_HOST/default while you query as another site). Constrain the host explicitly with +conHost:<siteIdentifier> (or +conHost:SYSTEM_HOST), and add +live:true / +working:true and +deleted:false as needed. See the Lucene content-search syntax docs.

sortstring

Sort clause, e.g. AwazonBook.title asc or modDate desc. Custom fields are qualified the same way as in query.

limitinteger

Maximum number of contentlets to return (page size).

offsetinteger

Zero-based result offset for paging.

userIdstring

Optional user id to run the search as (permissions are applied for this user). Defaults to the authenticated caller when omitted.

renderstring

When set to true, each matching contentlet's htmlpageasset/widget content is rendered and included in the response. Omit for raw field data only.

depthinteger

Relationship-loading depth (0-3): how many levels of related content to inline. -1 (default) loads none.

languageIdinteger

Language id to search in. Defaults to the system default language when omitted.

allCategoriesInfoboolean

When true, include full category metadata for category fields in the results.

Example request

{
  "query": "+contentType:AwazonBook +AwazonBook.featured:true +live:true +deleted:false",
  "sort": "modDate desc",
  "limit": 20,
  "depth": 1,
  "languageId": 1
}

Response

Search completed successfully

i18nMessagesMapobject
permissionsstring[]

Changes