Ghost-Meilisearch v1.2.2: Major Upgrade for Premium Content Support
Ghost-Meilisearch v1.2.2 brings premium content support to your Ghost blog searches. Now using Admin API integration, this update properly indexes members-only content with separate public/private fields, respecting access permissions while delivering lightning-fast search results for all users.

Hey everyone! I'm thrilled to announce the release of Ghost-Meilisearch v1.2.2. This is a significant update driven by your feedback, specifically addressing a major request: making search work seamlessly with premium, members-only content in Ghost.
If you run a Ghost membership site, you know how important it is for your subscribers to find the valuable content they're paying for. This update fundamentally changes how Ghost-Meilisearch handles content, ensuring your premium posts are indexed correctly and search results respect visibility rules.
The Big Leap: Switching to the Ghost Admin API
The most crucial change in v1.2.2 is the switch from using Ghost's Content API to the Admin API. Why the change?
- Access to All Content: The Admin API allows Ghost-Meilisearch to "see" and index all your posts, including those set to Members-only or Paid-members-only tiers. The Content API simply couldn't do this reliably.
- Respecting Visibility: By using the Admin API, the indexing process understands which content is public and which is not public.
- Smarter Search Results: This lays the groundwork for search results that can eventually be tailored based on a user's membership status (though the front-end UI implementation for logged-in status detection isn't part of this specific update yet, the backend now supports it).
The New Plaintext Fields
I've completely revamped how content is stored in the search index. Instead of a single plaintext field, we now have:
plaintext_public
- Contains text that's accessible to everyoneplaintext_private
- Contains text that's only for members
How it works with the <!--members-only-->
divider
Ghost-Meilisearch is now smart enough to recognize the <!--members-only-->
divider you use in the Ghost editor:
- Content Before Divider: Text before the divider goes into
plaintext_public
. - Content After Divider: Text after the divider goes into
plaintext_private
.
No Divider:
- If the post is public, all content goes into
plaintext_public
. - If the post is members-only (without a divider), all content goes into
plaintext_private
.
This structure gives Meilisearch the information needed to search content appropriately based on potential future access controls in the search UI. The search UI (@fanyangmeng/ghost-meilisearch-search-ui
) included in this release is already configured to search both fields but primarily highlights and displays snippets from the plaintext_public
field to avoid revealing private content in public search results.
Protecting Premium Content with Meilisearch Settings
While our new architecture separates content into plaintext_public
and plaintext_private
fields, there's one more critical step to ensure your premium content is properly protected: configuring Meilisearch's attribute settings.
Making Private Content Searchable but Not Visible
For membership sites, we want the ideal balance:
- Members-only content should be findable in search results
- But premium content should not be revealed to non-members
This requires a specific Meilisearch configuration where plaintext_private
is:
- Added to searchableAttributes so Meilisearch includes it when matching queries
- Removed from displayedAttributes so the actual premium content isn't returned in search results
The example config file already includes these settings (searchable: true
and displayed: false
for the plaintext_private
field):
Setting Up with the Updated Version
If you're upgrading from an earlier version, there are a few important changes to note:
- Environment variable changes:
- Replace
GHOST_KEY
withGHOST_ADMIN_API_KEY
in your environment variables - Generate a proper Admin API key from Ghost (instructions in README)
- Replace
- Update your package references:
- All packages have been updated to v1.2.2
- Update your CDN links and npm global installs as shown in the README
- Re-sync your content:
- You'll need to re-initialize and re-sync your search index to take advantage of the new content structure
Technical Improvements Under the Hood
Beyond the big features, I've made several improvements to the codebase:
Enhanced Text Processing
I've completely rewritten the text extraction logic to be more robust. The system now:
- Handles HTML content more intelligently
- Better preserves structure from your original content
- Properly extracts alt text from images for better accessibility in search
- Falls back gracefully if parsing fails
JWT Authentication for Admin API
I've implemented proper JWT token generation for secure Admin API access. This works across all deployment environments:
- Edge computing platforms (Cloudflare Workers)
- Serverless functions (Netlify, Vercel)
- Traditional Node.js environments
Better Error Handling & Logging
The webhook handler now provides more useful error messages and better logging throughout the system. You'll get clearer feedback when something goes wrong.
Why Upgrade?
If you:
- Run a Ghost site with members-only content
- Use the
<!--members-only-->
tag to split free/premium content - Want to offer search across your entire content library while respecting access permissions
then this update will be extremely valuable for your site!
Looking Forward
I'm committed to making ghost-meilisearch the best search solution for Ghost blogs. In future updates, I'm looking at:
- Adding support for searching email only content:
- Adding support for searching pages:
Wrapping Up
This upgrade represents a significant step forward for ghost-meilisearch, especially for those running membership sites. I'm excited to see how you all use these new features!
If you find Ghost-Meilisearch useful, please consider:
- ⭐ Starring the repo on GitHub
- 🤝 Contributing code or documentation
- ❤️ Sponsoring the project on GitHub Sponsors
Happy searching!
Previous Related Content:




Discussion