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.

Release v1.2.2 - Member Only Content Support · MFYDev/ghost-meilisearch
Major Improvements Enhanced Content Processing: Replaced single plaintext field with new plaintext_public and plaintext_private fields to better handle membership content (Thanks for #13 ) using a…

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 everyone
  • plaintext_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

Displayed and searchable attributes — Meilisearch documentation
Displayed and searchable attributes define what data Meilisearch returns after a successful query and which fields Meilisearch takes in account when searching. Knowing how to configure them can help improve your application’s performance.

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):

ghost-meilisearch/example.config.json at main · MFYDev/ghost-meilisearch
Add powerful, lightning-fast search to your Ghost blog with Meilisearch. This integration provides everything you need to create a seamless search experience for your readers. - MFYDev/ghost-meilis…

Setting Up with the Updated Version

If you're upgrading from an earlier version, there are a few important changes to note:

  1. Environment variable changes:
    • Replace GHOST_KEY with GHOST_ADMIN_API_KEY in your environment variables
    • Generate a proper Admin API key from Ghost (instructions in README)
  2. 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
  3. 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:
Email only content support · Issue #21 · MFYDev/ghost-meilisearch
This one is hard to test as a full test instance should be set up, need to double confirm as well
  • Adding support for searching pages:
Searching in pages as well · Issue #19 · MFYDev/ghost-meilisearch
As far as I understand currently only posts are indexed, not the pages. Including pages in search results would be one of the most asked features in Ghost community. I think it would be great to ha…

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:

Supercharging Your Ghost Blog with Meilisearch: A Powerful Search Integration
Transform your Ghost blog with lightning-fast search using the Ghost-Meilisearch integration. Deliver sub-50ms results, enjoy typo tolerance, and customize your search experience. Boost reader engagement with real-time indexing and seamless theme integration.
New in ghost-meilisearch: Deploy Your Webhook with Cloudflare Workers
Enhance your Ghost blog with lightning-fast search! Ghost-meilisearch now supports Cloudflare Workers alongside Netlify Functions, offering global edge distribution, generous free tier limits, and zero cold starts. Learn how to deploy for better performance and reader experience.
Elevating Ghost CMS Search: New Features in Ghost-Meilisearch 0.5.0
Discover how Ghost-Meilisearch v0.5.0 transforms blog search with new highlighting features and exact phrase matching. This update delivers lightning-fast, precise results by intelligently extracting plain text and generating context-rich excerpts to enhance reader experience and engagement.
Introducing AI-Powered Semantic Search with Meilisearch for Ghost CMS
Go beyond keywords! Ghost-Meilisearch v1.0.1 brings intelligent, AI-driven semantic search to your Ghost blog, helping readers find the content they mean, not just what they type. This upgrade understands concepts and intent, connecting readers with your valuable posts even when search terms differ.