orama-schema-resolver
v0.4.0
Published
Create your Orama's schema following the official specification
Downloads
12
Maintainers
Readme
🪄 Orama schema resolver
Create your Orama schema following the official specification.
Installation
You can install the package using npm
, yarn
or pnpm
:
npm i orama-schema-resolver
yarn add orama-schema-resolver
pnpm add orama-schema-resolver
Usage
import { create, insert, search } from '@oramasearch/orama';
import resolveSchema from 'orama-schema-resolver';
import * as fs from 'fs';
// You can parse data from any source, but we'll use a local file for this example
const data = JSON.parse(fs.readFileSync('./package.json').toString());
const schema = resolveSchema(data);
const db = create({ schema })
insert(db, data);
const results = search(db, {
term: 'orama'
});
console.log(results)