2.1.6 • Published 1 month ago

nestjs-meilisearch v2.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

About

This package is a simple wrapper around meilisearch-js.

Installation

This package requires meilisearch dependency to work properly.

yarn add nestjs-meilisearch meilisearch

Getting Started

The simplest way to use nestjs-meilisearch is to use MeiliSearchModule.forRoot or MeiliSearchModule.forRootAsync

import { Module } from '@nestjs-common';
import { MeiliSearchModule } from 'nestjs-meilisearch';

@Module({
  imports: [
    MeiliSearchModule.forRoot({
      host: 'http://127.0.0.1:7700',
      apiKey: 'masterKey',
    }),
  ],

  // or async
  MeiliSearchModule.forRootAsync({
    useFactory: () => ({
      host: 'http://127.0.0.1:7700',
      apiKey: 'masterKey',
    }),
  }),
})
export class AppModule {}

use @InjectMeiliSearch() decorator in any injectables to get a MeiliSearch client inside class

import { Injectable } from '@nestjs/common';
import { InjectMeiliSearch } from 'nestjs-meilisearch';
import { MeiliSearch } from 'meilisearch';
@Injectable()
export class TestService {
  public constructor(
    @InjectMeiliSearch() private readonly meiliSearch: MeiliSearch,
  ) {}
}

You can also use MeiliSearchService to add,update and delete documents. I'm planning to add further operations to this service.

License

Distributed under the MIT License. See LICENSE for more information.

2.1.6

1 month ago

2.1.5

8 months ago

2.1.4-0

8 months ago

2.1.4

8 months ago

2.1.3

1 year ago

2.1.2

2 years ago

2.1.1

3 years ago

2.0.3

3 years ago

2.0.4

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

2.0.0-2

3 years ago

2.0.0-1

3 years ago

2.0.0-0

3 years ago

1.0.1-1

3 years ago

1.0.1-0

3 years ago