Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mateonunez/lyra-match
Show which properties matches with your Lyra search
https://github.com/mateonunez/lyra-match
lyra match
Last synced: 2 days ago
JSON representation
Show which properties matches with your Lyra search
- Host: GitHub
- URL: https://github.com/mateonunez/lyra-match
- Owner: mateonunez
- License: mit
- Created: 2022-09-27T20:19:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-21T07:09:41.000Z (almost 2 years ago)
- Last Synced: 2024-05-06T12:26:38.813Z (8 months ago)
- Topics: lyra, match
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@mateonunez/lyra-match
- Size: 31.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ✏️ Match
Show which properties matches with your [Lyra](https://github.com/lyrasearch/lyra) search.
[![Tests](https://github.com/mateonunez/lyra-match/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mateonunez/lyra-match/actions/workflows/ci.yml)
## Installation
You can install Lyra using `npm`, `yarn`, `pnpm`:
```sh
npm i @mateonunez/lyra-match
```
```sh
yarn add @mateonunez/lyra-match
```
```sh
pnpm add @mateonunez/lyra-match
```## Usage
```js
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**
```js
{
matches: [
{
id: '57941602-6',
author: 'Lyra',
website: 'https://github.com/LyraSearch'
}
]
}
```# License
[MIT](/LICENSE)