Skip to content

Ingestion

Content must be ingested (indexed) into the sulu.ai platform before it can be searched. There are two paths: the CLI command for bulk or initial ingestion, and the event subscriber that keeps the index in sync as editors work.

CLI Ingestion Command

Use sulu:ai:intelligent-search:ingest to index your Sulu content:

# Ingest all providers, all locales declared by the webspaces
php bin/console sulu:ai:intelligent-search:ingest

# Restrict to one locale
php bin/console sulu:ai:intelligent-search:ingest --locale=en

# Ingest only pages (skip articles)
php bin/console sulu:ai:intelligent-search:ingest --provider=pages

# Ingest only a specific webspace
php bin/console sulu:ai:intelligent-search:ingest --locale=en --webspace=example

# Preview what would be ingested without sending
php bin/console sulu:ai:intelligent-search:ingest --dry-run

# Wipe the index before ingesting (full re-index)
php bin/console sulu:ai:intelligent-search:ingest --purge

# Override the host/scheme used in generated URLs
php bin/console sulu:ai:intelligent-search:ingest --host=www.example.com --scheme=https

Options

Option Short Description Default
--locale -l Content locale to ingest. If omitted, all locales from the webspace configuration are used. all locales
--provider -p Restrict to a specific provider (e.g. pages, articles) all providers
--webspace -w Sulu webspace key filter
--host Override host for generated URLs from RequestContext
--scheme URL scheme for generated URLs https
--batch-size -b Number of documents per ingestion batch 50
--purge Clear the intelligent-search index before ingesting off
--dry-run -d Preview documents without sending to the platform off

Note on --purge: purging wipes all documents in the intelligent-search index regardless of locale, webspace, or provider. The command emits a warning when --purge is combined with --locale or --provider because only the filtered slice will be re-ingested afterwards. Use it for full rebuilds, not partial refreshes.

Built-in Ingestion Providers

The bundle ships with two providers, usable with --provider:

  • pages — Sulu pages (always available)
  • articles — Sulu articles (only when SuluArticleBundle is installed)

To ingest content from a custom source, see Custom Ingestion Providers.

Chunking

Each Sulu document is split into multiple chunks before it is sent to the platform — chunked retrieval gives the LLM more focused context than entire pages. The chunker is configurable:

sulu_ai_platform:
    ingestion:
        chunker: markdown           # "markdown" (default), "section", or a service ID
        chunker_options:
            word_limit: 200         # Target max words per chunk (markdown chunker only)

Built-in chunkers:

  • markdown (default) — Renders the structure as a Markdown document (page title as H1, block items as H2 followed by their content) and splits it on a configurable word limit. Splitting is heading-aware: a chunk never ends on an orphan heading.
  • section — Splits one chunk per top-level structure section/property without re-rendering as Markdown.

To plug in a different strategy, set chunker to the service ID of a class implementing Sulu\Bundle\AiPlatformBundle\Ingestion\Chunker\ContentChunkerInterface and register it as a service.

Automatic Index Updates

The bundle keeps the index in sync with editor actions on both supported Sulu versions:

  • Publishing a page or article re-ingests it.
  • Unpublishing or deleting a page or article removes it from the index.

Article events only fire when SuluArticleBundle is installed. Ingestion failures are logged and never block the editor workflow — if the platform is unreachable, the publish still succeeds and the index falls out of sync until the next manual run.

Deployment

Run the ingest command as part of your deployment process to make sure new locales, schema changes, or content that was modified outside the normal publish flow ends up in the index:

php bin/console sulu:ai:intelligent-search:ingest

For a clean rebuild (for example after a chunker change or an index schema bump), combine with --purge:

php bin/console sulu:ai:intelligent-search:ingest --purge