This package is a plugin (experimental) for Lyra that aims to enhance lyra retrieval possibility.
import lyra from '@lyrasearch/lyra';
import {
advancedSearch,
afterInstertAdvancedQuery,
} from 'lyra-advanced-query-plugin';
const db = await lyra.create({
schema: {
author: 'string',
alive: 'boolean',
age: 'number',
},
hooks: {
afterInsert: afterInstertAdvancedQuery,
},
});
await insertWithHooks(lyrs, {
alive: false,
author: 'Daniele Fedeli',
age: 25,
});
const result = await advancedSearch(lyra, {
where: { alive: true, age: { '=': 25 } },
term: 'Daniele',
});