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
Allow structured criteria in search #931
Comments
We use http://lunrjs.com/ for search. So this idea is probably only feasible if Lunr supports something like this already. I have had a quick look in the documentation and I can't see anything. At the moment we only have three fields title, text and location, so even if we do manage it, there wont be many choices. |
There is this - elasticlunr, that is built on top of lunrjs. Perhaps this could help in this case. My specific use case is to lookup pages by tags. So if there could be a way to add that to the search index, that would be neat. |
elasticlunr looks interesting. However, its not clear to me if it will work with MihaiValentin/lunr-languages, "a collection of languages stemmers and stopwords for Lunr Javascript library." It may, but if we add multi-language support in the future, it would need to (see #826). Of interest is their claim that elasticlunr creates a smaller index than lunr.js. If so, that may be a factor for #859. It is worth some investigation at least. Thanks for the pointer. |
As a workaround you can put |
As per weixsong/elasticlunr.js#42 elasticlunr only works with lunr-langauge 0.0.4, while lunr-language is currently at 1.0.0. Until elasticlunr gets updated, I'm holding off on this. If and when the time comes, it shouldn't be too difficult to do. For that matter, as search is now in a plugin, someone could always fork the plugin and use elasticlunr if they wanted. |
For what I witness, the current search allows searching in titles with Also, nowadays (2024) lunr.js is unmaintained (last commit 2020). While we welcome enhancements to existing themes, we're also discussing creating a new, better default theme, which would probably use something else than lunr.js. @squidfunk also stated that he and his team are working on a standalone search plugin that is theme-agnostic and will bring such functionality, see the discussion starting here #3560 (comment). For these reasons, we'll close this as not planned! If someone wants to work on this anyway, we can re-open the issue. |
The current search works well as a free text lookup. I would like to have a search that allows more control on the filter criteria.
For instance, a search request for
title: awesome
should only list matches that haveawesome
in thetitle
.The text was updated successfully, but these errors were encountered: