Blog Sections Open
Making AjaxSearch Work with Content Rendered Through Ditto
AjaxSearch works with stored resource data, not with the final HTML generated by Ditto, so catalogs assembled from hidden source resources need a different search strategy.
This legacy question came from a very common Evolution architecture: the public site was built mostly with Ditto, while many source resources such as news items, catalog records, or price lists were hidden from direct publication. The result looked fine on the frontend, but AjaxSearch returned almost nothing useful.
The Core Limitation
AjaxSearch does not search the final rendered output of Ditto. It searches resource fields and, depending on configuration, selected TVs. That means it cannot magically index text that only appears after a listing snippet has assembled the page.
Why the Search Felt Broken
If most visible information is printed by Ditto and the underlying resources are hidden or modeled in a way AjaxSearch is not configured to read, the search results feel incomplete even though the snippet itself is behaving correctly.
What Actually Works
- search the underlying resources directly
- make sure the needed fields are included in AjaxSearch configuration
- index the relevant TVs explicitly instead of assuming Ditto output is searchable
- for larger catalogs, consider a separate search dataset or a custom index
In short, the answer is not to make AjaxSearch search “Ditto output”. The answer is to make the underlying documents represent the content you want to search.
When to Rethink the Data Model
If a site depends on heavy listing logic, unpublished source records, or complex stitched-together views, the search layer often needs its own architecture. This old topic is a useful reminder that snippet output and search indexing are not the same problem.
Creating Documents Programmatically with TV Values in MODX Revo
How to create a resource through the MODX Revo API and then assign TV values correctly after the resource has been saved.
Why Ditto Ignores `parents` When `documents` Is Set
A practical explanation of why Ditto stops honoring parents when a fixed documents list is passed, and how to choose the right filtering strategy.