Docs
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
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:
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.
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.
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.
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.
The contents of the search_filters
tag pair must be a valid JSON object.
The per_page
parameter is unique to Algolia. Use the limit
parameter as noted above for Meilisearch.
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:entries
tag result.
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.
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.php
file in your add-on and make sure it has the following signature.
It is highly suggested to use the Queue module when using Dexter, especially if you'll be using the batch index rebuilding feature.
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 .