@mateonunez/lyra-match
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

✏️ Match

Show which properties matches with your Lyra search.

Tests

Installation

You can install Lyra using npm, yarn, pnpm:

npm i @mateonunez/lyra-match
yarn add @mateonunez/lyra-match
pnpm add @mateonunez/lyra-match

Usage

import { create, insert, search } from "@lyrasearch/lyra"
import { match } from "@mateonunez/lyra-match"

(() => {
  const lyra = create({
    schema: {
      author: "string",
      website: "string",
      contributors: "number",
      stars: "number",
      forks: "number",
      language: "string"
    }
  })

  insert(lyra, {
    author: "Lyra",
    website: "https://github.com/LyraSearch",
    contributors: 21,
    stars: 3350,
    forks: 62,
    language: "TypeScript"
  })

  const properties = { term: "Lyra" }
  const { hits } = search(lyra, properties)
  const matches = match(hits, properties)

  console.log({ matches })
})();

Results

{
  matches: [
    {
      id: '57941602-6',
      author: 'Lyra',
      website: 'https://github.com/LyraSearch'
    }
  ]
}

License

MIT

/@mateonunez/lyra-match/

    Package Sidebar

    Install

    npm i @mateonunez/lyra-match

    Weekly Downloads

    0

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    25.5 kB

    Total Files

    17

    Last publish

    Collaborators

    • mateonunez