@del-internet/support-search
v1.1.0
Published
TypeScript package to handle full-text search
Downloads
5
Readme
Install
npm i @del-internet/support-search
Usage
import factory from '@del-internet/support-search';
const config = {....}
const Manager = factory(config);
Available methods
update
,delete
,search
,createIndex
,deleteIndex
Example
Manipulation
// to update something on meilisearch engine
await Manager.driver('meilisearch').update([{}])
// to delete something on meilisearch engine
await Manager.driver('meilisearch').delete([{}])
// to createIndex something on meilisearch engine
await Manager.driver('meilisearch').createIndex('index-name', {...configurations})
// to deleteIndex something on meilisearch engine
await Manager.driver('meilisearch').deleteIndex('index-name')
Searching
// to search something on meilisearch engine
const builder = Builder.within('index-name')
.search('search-string')
.take(50)
.ignore(50)
.withMeta('matchingStrategy', 'all');
// do some ordering
builder.orderBy(order.key, order.direction);
await Manager.driver('meilisearch').search(builder)