Meilisearch

A Search Platform for the Rest of Us

About Me

  • Michael Born
  • Central NY
  • Ortusian since 2019
  • 3rd search-related talk
  • Lots of search time

Intro to Meilisearch

  • What is Meilisearch?
  • Why Meilisearch?

What is Meilisearch?

  • "New kid on the block"
  • Open source
  • Written in Rust
  • Lightning-quick
  • Lightweight
  • Designed for simplicity
  • Still in beta

Why Meilisearch?

  • A new approach to search
  • Designed around speed and simplicity
  • Great for smaller websites with lighter use cases
  • Multitenancy is a promising new feature

Why Meilisearch?

Introducing cbMeilisearch

Introducing cbMeilisearch

  • Fluent API wrapper
  • Configure with env vars
  • returns HyperResponse
    • isSuccess()
    • isError()
    • getData()
    • json()
  • Simplifies
    • Indexing
    • Storage
    • Search
    • API keys
    • Dumps
    • Stats
    • Version
    • etc, etc.

cbMeiilsearch API call

var cbmsClient 	= getInstance( "Client@cbmeilisearch" );
var response 	= cbmsClient.search( "products", { "q" : "watch" } );

cbMeiilsearch API call

var cbmsClient 	= getInstance( "Client@cbmeilisearch" );
var response 	= cbmsClient.search( "products", { "q" : "watch" } );

if ( !response.isSuccess() ){
  throw(
    message = "Error searching from Meilisearch",
    detail = response.getData()
  );
}

var results = response.json();

cbMeiilsearch API call

var cbmsClient 	= getInstance( "Client@cbmeilisearch" );
var response 	= cbmsClient.createIndex( "books" );

if ( !response.isSuccess() ){
  throw(
    message = "Error creating index",
    detail = response.getData()
  );
}

var task = response.json();

cbmsClient.waitForTask( task.taskUid );

Meilisearch: Getting Started

  • Starting a Meilisearch instance
  • Configuring a Meilisearch instance
  • The Meilisearch Dashboard

Starting Meilisearch

  • Digital Ocean One-Click App
  • Docker container
docker run \
    -p 7700:7700 \
    getmeili/meilisearch:v0.28 \
    meilisearch \
    --env="development"

Meilisearch Instance Configuration

  • Environment
  • Master key
  • Analytics
  • HTTP address/port
  • Importing dumps
  • Importing snapshots
  • Max payload size
  • Database storage location
  • Database dump destination
  • much, much more!

Meilisearch Instance Configuration

docker run \
    -p 7700:7700 \
    getmeili/meilisearch \
    meilisearch \
    --env="development"
docker run \
    -p 9900:9900 \
    getmeili/meilisearch \
    meilisearch \
    --env="development" \
    --http-addr 'http:127.0.0.1:9900'
docker run \
    -p 9900:9900 \
    --env MEILI_HTTP_ADDR='http:127.0.0.1:9900' \
    getmeili/meilisearch \
    meilisearch \
    --env="development"

The Meilisearch Dashboard

DEMO TIME

cbMeilisearch: Getting Started

  • Installing cbMeilisearch
  • Configuring cbMeilisearch

cbMeilisearch: Installation

box install cbmeilisearch

cbMeilisearch: Configuration

box install cbmeilisearch

API Security

  1. Master keys
  2. API keys

Master Keys

  • Not set by default
  • Required for production environment
  • Only configurable at creation or from command line

API Keys

  • The Meilisearch API is unsecured by default
  • Set a master key to secure the API
    • this will create two default API keys, Search and Admin
    • The master key can be used as an API key.

API Keys

  • API key features:
    • Expiration date/time
    • Index-based permissions
    • Endpoint-based permissions

API Key DEMO TIME

cbMeilisearch: TODO

  • Tenant tokens
  • API Documentation
  • Compatibility w/ PHP SDK
  • ContentBox integration

Thank You!

Resources

  • Meilisearch.com
  • Meilisearch API docs
  • cbMeilisearch documentation
Made with Slides.com