npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2026 – Pkg Stats / Ryan Hefner

@vymalo/medusa-meilisearch

v1.0.17

Published

πŸ” Powerful, lightning-fast search integration for MedusaJS using Meilisearch

Readme

MedusaJS Meilisearch Integration

πŸ” Powerful, lightning-fast search integration for MedusaJS using Meilisearch

🌟 Features

  • Instant, typo-tolerant search capabilities
  • Highly configurable indexing
  • Real-time search updates
  • Advanced filtering and ranking
  • Seamless MedusaJS integration

πŸ—οΈ Search Architecture

graph TD
    A[MedusaJS Database] -->|Indexing| B[Meilisearch]
    B -->|Instant Search| C[Client Application]
    
    subgraph Search Configuration
    Config[Meilisearch Config]
    Indexes[Multiple Index Settings]
    Filters[Advanced Filtering]
    end

πŸ“¦ Installation

Install the package using npm:

npm install @vymalo/medusa-meilisearch

Or using yarn:

yarn add @vymalo/medusa-meilisearch

πŸš€ Configuration Types

Core Configuration Interface

interface MeilisearchAddOnOptions {
    // Meilisearch client configuration
    config: Config;  // Meilisearch connection settings

    // Index-specific settings
    settings?: {
        [key: string]: SearchTypes.IndexSettings;
    };
}

Search Options

interface IndexSettings {
    // Provider-specific index configuration
    indexSettings: Record<string, unknown>;

    // Primary key for unique document identification
    primaryKey?: string;

    // Optional document transformer
    transformer?: (document: any) => any;
}

Configuration Breakdown

  • indexSettings: Allows provider-specific configuration

    • e.g., searchableAttributes, filterableAttributes
    • Completely flexible key-value configuration
  • primaryKey:

    • Ensures unique documents in the index
    • Helps Meilisearch identify and manage documents
    • Recommended for data integrity
  • transformer:

    • Modify documents before indexing
    • Allows data cleaning, restructuring
    • Useful for complex data transformations

πŸš€ Usage Example

modules: [
    {
        resolve: '@vymalo/medusa-meilisearch',
        options: {
            // Meilisearch connection configuration
            config: {
                host: process.env.MEILISEARCH_HOST,
                apiKey: process.env.MEILISEARCH_API_KEY,
            },

            // Index-specific settings
            settings: {
                products: {
                    // Meilisearch-specific index settings
                    indexSettings: {
                        searchableAttributes: ['title', 'description'],
                        displayedAttributes: ['id', 'title', 'price'],
                        filterableAttributes: ['category', 'price']
                    },

                    // Specify primary key
                    primaryKey: 'id',

                    // Transform documents before indexing
                    transformer: (product) => ({
                        ...product,
                        // Add custom transformations
                        searchText: `${product.title} ${product.description}`,
                        // Normalize or clean data
                        price: Number(product.price).toFixed(2)
                    })
                }
            }
        },
    },
]

πŸ›‘οΈ Key Capabilities

  • Flexible index configuration
  • Dynamic search filtering
  • Pagination support
  • Custom ranking and relevance
  • Multi-index management

🌐 Environment Variables

Required:

  • MEILISEARCH_HOST: Meilisearch server URL
  • MEILISEARCH_API_KEY: Meilisearch admin API key

πŸš€ Performance Tips

  • Use appropriate index settings
  • Leverage filtering and faceting
  • Implement pagination
  • Monitor index size and query performance
  • Handle potential null/undefined values

🀝 Contributing

Contributions welcome!

  • Improve transformation logic
  • Optimize indexing performance
  • Share search configuration patterns

πŸ“„ License

Check the license

πŸ”— Related Resources