Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for https://lunrjs.com/ search index #527

Open
randombenj opened this issue May 30, 2023 · 3 comments
Open

Add support for https://lunrjs.com/ search index #527

randombenj opened this issue May 30, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@randombenj
Copy link
Member

It would be nice to have search across projects, to support this let's have a look at lunrjs as it
seems to be the default frontend search thingy.

@randombenj randombenj added the enhancement New feature or request label May 30, 2023
@goerks
Copy link

goerks commented Mar 26, 2024

Hi @randombenj, I like this approach.

We are using the Hugo static website generator based on markdown documents. We use the Relearn Hugo theme which is shipped with the lunrjs search engine. Therefore each Hugo documentation has a index.search.js containing the prebuilt search index.

var relearn_search_index = [
  {
    "content": " Documentation as Code You should write the documentation ...,
    "description": "Explains the principle of Documentation as Code.",
    "tags": null,
    "title": "Documentation as Code",
    "uri": "/training/advanced/docs-as-code/index.html"
  },
  ...
]

Minimal setup

  • Each project provides its own lunr search index (index.search.js in the document root directory)
  • When searching in the docat search, the latest version of each project should be considered

Advanced setup

  • Allow to search in older versions too
  • Support custom scoring and boosts

@randombenj
Copy link
Member Author

@goerks We tried to implement search multiple times now, unfortunately it seems to be a harder problem than it looks ...

@reglim Is this something we looked into when you tried to implement search?

@reglim
Copy link
Contributor

reglim commented Apr 4, 2024

@randombenj Yes I did. I think this idea was dropped first of all because to serve the pre-built index it would need to be built in the backend which is not in JavaScript but Python. Also, Lunr doesn't allow you update an existing index, which would mean that it would have to be rebuilt completely every time something is updated.

An alternative could be elasticlunr that allows you to update documents, but that still has the issue of building it in the backend.

Also, in my testing, extracting all the text from the uploaded zip files can also be quite expensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants