BoldMinded Docs
  • Overview
  • Advanced Categories
    • Docs
      • Installation
      • Requirements
      • Setup & Configuration
        • Hidden Config Options
        • Multi-Site Manager
      • Template Tags
      • FAQs
  • Ansel
    • Docs
      • Installation
      • Upgrading
      • Requirements
      • Settings
      • Usage
        • Channel:Form
      • Troubleshooting
      • Template Tags
      • Publisher Support
    • FAQs
  • Bloqs
    • Docs
      • Why Bloqs?
      • Features
        • Add Bloq Menu
        • Nesting
        • Cloning
        • Drafts
        • Bloq Usage
        • Deprecated Bloqs
        • Caching
        • Profiling
        • Bloq Components
        • Bloq Groups
      • Installation
      • Requirements & Compatibility
      • Setup & Configuration
        • Hidden Config Options
      • Creating Bloqs
      • Template Tags
        • Twig/Blade
        • Examples
      • Context Variables
      • Add-on Developers
    • FAQs
  • Carson
    • Docs
      • Installation
      • Requirements
      • Fields
        • Omni
          • Hidden Config
        • Assistant
        • SEO
      • Troubleshooting
  • Custom System Messages
    • Docs
      • Installation
      • Requirements
      • Variables
      • Template Tags
  • DataGrab
    • Docs
      • Installation & Upgrading
        • Upgrading from 3 to 4
        • Upgrading from 4 to 5
        • Upgrading from 5 to 6
      • Requirements
      • Troubleshooting
      • Configuring Imports
      • Running Imports
      • Automatic Imports
        • Importing with cron
        • Importing with cron (Deprecated)
      • Endpoints
      • Configuration Options
        • Config File Options
        • Increasing PHP memory limit
      • Import Types
        • CSV
          • Importing into Grid or Matrix field
        • JSON
          • Example file
        • WordPress
        • XML
          • Example file
        • Creating your own import type
      • Assigning Authors
      • Field Types
        • Assets
        • Ansel
        • Bloqs
        • Calendar
        • Channel Images
        • Date
        • File
        • File Grid
        • Fluid
        • Grid
        • Low Events
        • Relationships
        • Simple Grids & Tables
        • Tag & Tagger
        • Matrix (Deprecated)
        • Creating your own fieldtype
      • Publisher Support
    • FAQs
  • Feature Flags
    • Docs
      • Installation & Upgrading
      • Requirements
      • Configuration
      • Template Tags
      • A/B Testing
    • FAQs
  • Fluidity
    • Docs
      • Installation & Upgrading
      • Requirements
      • Configuration
      • Demos
    • FAQs
  • Logit
    • Docs
      • Installation
      • Requirements
      • Configuration
    • FAQs
  • Publisher
    • Docs
      • Installation
      • Requirements
      • Issues & Tips
      • Languages
      • Template Tags
        • Forms
        • Email Notification Templates
        • Channel:Form
        • Twig
      • URL Translations
      • Auto Translations
      • Diffs
      • Drafts
      • Categories
      • Phrases
      • Persistence
      • Performance
      • Add-ons
        • First Party
        • Third Party
      • Hidden Config
      • Extending Publisher
    • FAQs
  • Reading Time PRo
    • Docs
      • Installation
      • Requirements
      • Configuration
      • Template Tags
  • Reel
    • Docs
      • Installation
      • Requirements
      • Settings
      • Field Tags
    • FAQs
  • Simple Grids & Tables
    • Docs
      • Installation
      • Requirements
      • Template Tags
      • CSV File Imports
      • Field Settings
      • GraphQL
      • Advanced Configuration (deprecated)
    • FAQs
  • Sitemap
    • Docs
      • Installation
      • Requirements
      • Configuration & Usage
    • FAQs
  • Snaptcha
    • Docs
      • Installation
      • Requirements
      • Configuration
      • Template Tags
      • Developers
    • FAQs
  • Speedy
    • Docs
      • Installation & Updating
      • Requirements
      • Configuration
      • Template Tags
      • Static Caching
        • Real World Example
      • Frontedit Support
      • Control Panel
      • Migrating from CE Cache
      • Diagnostics
      • CLI Commands
      • Cloudflare Support (Reverse Proxy Purging)
    • FAQs
  • Trek (unreleased)
    • Docs
      • Configuration
    • FAQs
  • Queue
    • Docs
  • Dexter
    • Docs
Powered by GitBook
On this page
  • What Is Dexter
  • Configuring Indexes
  • Template Tags
  • 3rd party add-on support
  • Queue
  • Screenshots

Was this helpful?

  1. Dexter

Docs

Last updated 4 days ago

Was this helpful?

What Is Dexter

Dexter is a highly configurable add-on that can index your ExpressionEngine entries into Algolia or Meilesearchwhen when an entry is added, updated, or deleted. It can also perform full index rebuilds from its admin page. It is not plug and play. It does require some setup and configuration, and an understanding of how Algolia or Meilisearch work.

No two search implementations are alike. Each site has its specific business needs and rules about how its content is indexed and how it is searched. Dexter can't to solve for every possible scenario. Think of Dexter more of a framework than a fully pre-configured add-on. It is setup to handle most native ExpressionEngine fields and categories out of the box. You will need to add a $config['dexter'] = []; array to your config.php file to determine what Dexter should index and how. You can copy the array from the dexter/Config/settings.php file to get started.

Dexter has basic front-end template tags to perform searches against Algolia or Meilisearch. However, for the best experience, we recommend you bring your own front-end. Algolia and Meilisearch excel at faceted indexing and searching, which usually require JavaScript based search and filtering components. or developer hubs are good places to start.

Pipelines

While Dexter does handle a lot of stuff out of the box, if you are in need of some custom behaviors, or modification of data that is indexed, making a new pipeline is the answer. For this you will need some PHP knowledge. Pipelines must be namespaced classes. You can include additional pipelines by adding them to your config file:

$config['dexter'] = [
    'pipelines' => [
        \BoldMinded\DexterPipelines\Pipeline\ExamplePipeline::class,
    ]
];

To make it easier to include custom pipelines the dexter_pipelines add-on is included with Dexter. Since you will be adding files unique to your site to this add-on, do not update it when you update Dexter with a new version.

Configuring Indexes

Algolia and Meilisearch both provide admin interfaces to configure an index and its searchable properties. There is no need for Dexter to try to replicate these administration features in the ExpressionEngine control panel. You will need to use the native interface of your chosen search provider to define which properties/fields are searchable, filterable, faceted, etc. It is easiest to do this after 1 or more entries are indexed in either provider. When Dexter sends the JSON object to either provider it automatically creates documents in an index that map to that JSON object.

BoldMinded can not offer support on how to configure indexes or how to create custom pipelines. For guidance on pipelines, refer to the the `Pipelines` directory in Dexter for examples or the accompanying dexter_pipelines add-on.

Template Tags

Searching is currently limited to a single index for either provider. Algolia supports searching multiple indexes out of the box, but Meilisearch does not, and requires additional steps to support multi-index searching. Thus, for the time being, searching is limited to 1 index if using the EE template tag.

BoldMinded can not offer support on how to construct queries. Filtering can be very complex and as you can see in the example below each provider has a unique syntax. We have added support for both, so long as you construct the query correctly and have properly set the fields in the respective providers to be filterable or faceted fields (the most common mistake is querying a field that is not set to be filterable). If you are experiencing an issue, check your ExpressionEngine developer logs.

Due to the complex nature of the search parameters, they are not defined as native EE tag parameters. There will be too many parsing issues. For this reason Dexter looks for a specific search_filters tag pair and uses the contents of that tag as the search filter.

Meilisearch

The contents of the search_filters tag pair must be a valid JSON object.

{exp:dexter:search index="test_people" term="luke skywalker"}
    {search_filters}
        {
            "limit": 1,
            "offset": 0,
            "filter": ["status = 'open'", "entry_date >= 1732312020"]
        }
    {/search_filters}

    {if no_results}
        Nope
    {/if}

    {title}
    {ansel}
        {url}
    {/ansel}
{/exp:dexter:search}

Algolia

The per_page parameter is unique to Algolia. Use the limit parameter as noted above for Meilisearch.

{exp:dexter:search index="test_people" term="luke skywalker" per_page="10"}
    {search_filters}
        status:open AND entry_date >= 1732312020
    {/search_filters}

    {if no_results}
        Nope
    {/if}

    {title}
    {ansel}
        {url}
    {/ansel}
{/exp:dexter:search}

Using channel:entries to display results

If the dexter:search tag is not rendering as you expect, perhaps because of how the data is structured in the index (a deeply nested object will not work with the EE template parser), you can use the entry_ids_only parameter on the tag, and the {entry_ids} variable will print a pipe delimited list of entry IDs that you can then use in achannel:entries tag, then you have access to anything and everything related to the entry. This is a perfectly viable approach - let a powerful search engine do the hard work and return a small set of IDs, which you can then use to display the result.

If you are not using the entry_ids_only parameter, remember that the variables in the result are the properties you have indexed in Algolia or Meliesearch, so it may not align exactly with what you normally expect to see in a channel:entriestag result.

{exp:dexter:search index="test_people" term="luke" entry_ids_only="yes"}
    {search_filters}
        {
            "limit": 1,
            "offset": 0,
            "filter": ["status = 'open'", "entry_date >= 1732312020"]
        }
    {/search_filters}

    {exp:channel:entries entry_id="{entry_ids}"}
        {title}
    {/exp:channel:entries}
{/exp:dexter:search}

Coilpack Support

If you're using Coilpack you can also use Twig or Blade templates to render results. The search_filters parameter is handled as a normal tag parameter since you don't run into template parsing issues using Twig or Blade. Here is an example of the same search tags in Twig.

{% set search = exp.dexter.search({
    index: 'test_people',
    term: 'luke',
    search_filters: {
        limit: 1,
        offset: 0,
        filter: '["status = \'open\'", "entry_date >= 1732312020"]'
    }
}) %}

{% for result in search %}
    {{ result.title }}
{% endfor %}

{% set entryIds = exp.dexter.search({
    index: 'test_people',
    search_filters: {
        limit: 10,
        offset: 0,
    },
    entry_ids_only: true
}) %}

{{ entryIds }}

3rd party add-on support

If you have add-on with a fieldtype you can also add support for Dexter directly into your add-on. Create a dexter.your_addon.phpfile in your add-on and make sure it has the following signature.

use BoldMinded\Dexter\Service\Config;
use BoldMinded\Dexter\Service\Field\FieldTypeInterface;
use ExpressionEngine\Model\Channel\ChannelEntry;
use ExpressionEngine\Model\Content\FieldFacade;

class Your_addon_dexter implements FieldTypeInterface
{
    public function process(
        ChannelEntry $channelEntry,
        FieldFacade $fieldFacade,
        Config $config,
        $value
    ): array {
        // Do stuff to format data for Algolia or Meilsearch
        return [
            'foobar' => 'bazz'
        ];       
    }
}

Queue

It is highly suggested to use the Queue module when using Dexter, especially if you'll be using the batch index rebuilding feature.

Screenshots

Dexter's module settings page. This is where you can rebuild an index from scratch.

After saving an entry you'll be notified of it being indexed.

Then in Meilisearch or Algolia you can see what is indexed.

The search template tags are intended for simple queries and results display. If you need users to be able to select multiple facets to filter the result set dynamically, like you're used to seeing on ecommerce sites such as , we highly recommend using a JavaScript based search component.

For more information on how to use the search filter refer to the .

For more information on how to use the search filter refer to the .

Algolia
Meilisearch
Zappos
Meilisearch docs
Algolia search docs