Friends Of AdonisFriends Of Adonis

Getting Started

Installation

Install and configure the package using the following command :

node ace add @foadonis/magnify

Configure your Model

Magnify tries to be as easy as possible to configure. To accomplish that, it brings a Searchable mixin to make any Lucid model Searchable.

A Searchable model will be automatically synchronized with your Search engine.

app/models/post.ts
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;
}

Configure your Search Engine

On this page