PHPackages                             fitzage/optimus-bard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. fitzage/optimus-bard

ActiveLibrary[Search &amp; Filtering](/categories/search)

fitzage/optimus-bard
====================

Optimus Bard takes the content from a Statamic Bard field and transforms it into a string when updating your search index

v2.1.0(2mo ago)33.7k↓22.2%[3 issues](https://github.com/fitzage/optimus-bard/issues)MITPHPPHP ^8.2

Since Oct 8Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/fitzage/optimus-bard)[ Packagist](https://packagist.org/packages/fitzage/optimus-bard)[ RSS](/packages/fitzage-optimus-bard/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (9)Used By (0)

Optimus Bard v2.0
=================

[](#optimus-bard-v20)

> Advanced search transformer for Statamic Bard fields with deep content extraction and Statamic 5 support

✨ What's New in v2.0
--------------------

[](#-whats-new-in-v20)

- **Statamic 5 Support**: Fully compatible with Statamic 5 and Laravel 11+
- **Deep Content Extraction**: Recursively extracts content from nested Bard fields and complex sets
- **Enhanced Set Processing**: Automatically detects and extracts content from all text-bearing fields within sets
- **Improved Error Handling**: Graceful fallbacks for malformed content or missing blueprints
- **Modern PHP**: Requires PHP 8.2+ with modern Laravel helpers

Features
--------

[](#features)

What this addon does:

- **Deep Content Extraction**: Processes not just top-level Bard text blocks, but also recursively extracts content from:
    - Nested Bard fields within sets
    - Text fields, textareas, and markdown fields within component sets
    - Title, description, and content fields in complex page builders
- **Smart Set Processing**: Automatically identifies content-bearing fields without requiring manual configuration
- **Backward Compatibility**: Maintains compatibility with existing v1.x configurations
- **Configurable Depth**: Prevents infinite recursion with configurable extraction depth limits
- **Enhanced Cleanup**: Improved text cleaning and normalization for better search results

Requirements
------------

[](#requirements)

- PHP ^8.2
- Statamic ^5.0
- Laravel ^11.0

Installation
------------

[](#installation)

You can search for this addon in the `Tools > Addons` section of the Statamic control panel and click **install**, or run the following command from your project root:

```
composer require fitzage/optimus-bard
```

Basic Usage
-----------

[](#basic-usage)

Configure your search indexes using [the Statamic search documentation](https://statamic.dev/search).

In `config/statamic/search.php`, add the following at the top of the file, below the `
