Skip to content

Allow structured criteria in search #931

Closed as not planned
Closed as not planned

Description

@sriv

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.

Activity

  1. d0ugal commented on May 5, 2016

    @d0ugal
    Contributor

    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.

  2. sriv commented on May 5, 2016

    @sriv
    Author

    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.

  3. waylan commented on May 5, 2016

    @waylan
    Contributor

    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.

  4. memeplex commented on Jul 28, 2016

    @memeplex
    Contributor

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

  5. added this to the 1.0.0 milestone on Feb 6, 2018
  6. waylan commented on Feb 14, 2018

    @waylan
    Contributor

    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.

  7. modified the milestones: 1.0.0, Post 1.0 on Feb 28, 2018
  8. pawamoy commented on Apr 15, 2024

    @pawamoy
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions