@foadonis/magnify
v0.2.1
Published
Plug and play full-text search for your Adonis application.
Downloads
24
Maintainers
Readme
@foadonis/magnify
Plug and play full-text search for your Adonis application
Description
Magnify provides a simple, driver based solution for adding full-text search to your Lucid models. Using Lucid hooks, Magnify automatically keep your search indexes in sync with your database.
Currently, Magnify ships with Algolia, Meilisearch and Typesense engines. Furthermore, writing custom engines is simple and you are free to extend Magnify with your own search implementations.
import { compose } from '@adonisjs/core/helpers'
import { BaseModel, column } from '@adonisjs/lucid/orm'
import { Searchable } from '@foadonis/magnify'
export default class Post extends compose(BaseModel, Searchable) {
@column({ isPrimary: true })
declare id: string
@column()
declare title: string
}
import Post from '#models/post'
const posts = await Post.search('Adonis').take(10).get()
Quickstart
Installation & Getting Started