---
title: "Search content with Lucene syntax"
method: POST
path: "/api/v1/content/_search"
tags: ["Content"]
---

# Search content with Lucene syntax

`POST /api/v1/content/_search`

## Request

- Base URL: `https://docs.anzworldline-solutions.com.au`
- URL: `https://docs.anzworldline-solutions.com.au/api/v1/content/_search`
- Auth: none declared
- TypeScript: <https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/docs/api/v1/content/_search/post.ts> (a function with typed inputs; its response is checked against the schema)

Performs a comprehensive content search using [Lucene query syntax](https://dev.dotcms.com/docs/content-search-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.

## Query parameters

- `rememberQuery` boolean

## Request body

- SearchForm: Content search request. `query` is a Lucene expression; the remaining fields control paging, sorting, language, and how results are rendered.
  - `query` string: 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.
  - `sort` string: Sort clause, e.g. `AwazonBook.title asc` or `modDate desc`. Custom fields are qualified the same way as in `query`.
  - `limit` integer: Maximum number of contentlets to return (page size).
  - `offset` integer: Zero-based result offset for paging.
  - `userId` string: Optional user id to run the search as (permissions are applied for this user). Defaults to the authenticated caller when omitted.
  - `render` string: When set to `true`, each matching contentlet's `htmlpageasset`/widget content is rendered and included in the response. Omit for raw field data only.
  - `depth` integer: Relationship-loading depth (0-3): how many levels of related content to inline. `-1` (default) loads none.
  - `languageId` integer: Language id to search in. Defaults to the system default language when omitted.
  - `allCategoriesInfo` boolean: When `true`, include full category metadata for category fields in the results.

## Response `200`

Search completed successfully

- ResponseEntitySearchView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` SearchView
    - `resultsSize` integer
    - `queryTook` integer
    - `contentTook` integer
    - `jsonObjectView` JsonObjectView
      - `jsonObject` object
        - `asMap` object
        - `empty` boolean
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400`: Invalid search parameters or malformed query
- `401`: Authentication required
- `403`: Insufficient permissions to access content
- `500`: Internal server error during search

## Changes

- **2026-10-30** `4fd8e917d458`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/changes/api/v1/content/_search/post.md)

---

[API](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api.md) - [All operations](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/revisions/4fd8e917d458?raw)
