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

Allow structured criteria in search #931

Closed
sriv opened this issue May 5, 2016 · 6 comments
Closed

Allow structured criteria in search #931

sriv opened this issue May 5, 2016 · 6 comments

Comments

@sriv
Copy link

sriv commented May 5, 2016

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 have awesome in the title.

@d0ugal
Copy link
Member

d0ugal commented May 5, 2016

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.

@sriv
Copy link
Author

sriv commented May 5, 2016

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.

@waylan
Copy link
Member

waylan commented May 5, 2016

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.

@memeplex
Copy link
Contributor

As a workaround you can put title:<title> into your document, maybe inside an html comment, I guess.

@waylan waylan added the Plugins label Nov 1, 2017
@waylan waylan added this to the 1.0.0 milestone Feb 6, 2018
@waylan
Copy link
Member

waylan commented Feb 14, 2018

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.

@waylan waylan modified the milestones: 1.0.0, Post 1.0 Feb 28, 2018
@pawamoy
Copy link
Sponsor Contributor

pawamoy commented Apr 15, 2024

For what I witness, the current search allows searching in titles with title:validation, etc.

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.

@pawamoy pawamoy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants