pelican-plugins / search

Pelican plugin that adds site search capability
49 stars 9 forks source link

Support for Lyra JS #27

Closed paulocoutinhox closed 1 year ago

paulocoutinhox commented 1 year ago

Hi,

I have a suggestion to a feature.

You can use Lyra JS (https://lyrajs.io/) that is a javascript engine for document index like elasticsearch and you don't need WebAssembly.

import { create, insert, search } from "@lyrasearch/lyra";
const db = await create({
  schema: {
    quote: "string",
    author: "string",
  }
});
await insert(db, {
  quote: "I feel as if I'm always on the verge of waking up",
  author: "Fernando Pessoa"
});
const results = await search(db, {
  term: "waking up"
});

Maybe the plugin can create the index and the JS search function can use it.

justinmayer commented 1 year ago

I always envisioned that this plugin could eventually have a setting that allows the user to choose their preferred search engine. So while I originally chose Stork because it is an excellent search engine, if anyone wants to submit a pull request that adds support for alternative search engines, I think that such enhancements would be useful additions to the project.

justinmayer commented 1 year ago

I'm closing this issue in favor of #35, which is more broadly-focused on alternatives to Stork.