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

Search the pages/blog in all versions #19

Closed
micael-atos opened this issue Nov 25, 2020 · 1 comment
Closed

Search the pages/blog in all versions #19

micael-atos opened this issue Nov 25, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@micael-atos
Copy link

micael-atos commented Nov 25, 2020

Currently it's possible to search in the pages/blog only with the latest version. It's not obvious for a user to go to the latest version to find information in the pages/blog.

One way that this could be achieved is using the lunr.Query.presence.PROHIBITED field from lunr:

                versionExcluded = (...);
                if (versionToSearch) {
                  query.term(versionExcluded, {
                    fields: ["version"],
                    boost: 0,
                    presence: lunr.Query.presence.PROHIBITED,
                  });

And not link the pages and the blog to the latest version while creating the index, keep it as undefined:

          if (useDocVersioning) {
            indexDoc.version = docVersion;  // ? docVersion : docVersions[0];
          }
@cmfcmf cmfcmf added the enhancement New feature or request label Dec 26, 2020
@cmfcmf
Copy link
Owner

cmfcmf commented Dec 26, 2020

Thank you for your detailed explanation and blueprint for the solution! This indeed was quite the confusing behavior and has been fixed in version 0.5.0. 🎉

@cmfcmf cmfcmf closed this as completed Dec 26, 2020
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

2 participants