doks icon indicating copy to clipboard operation
doks copied to clipboard

Add Algolia Search (next to FlexSearch) as an option

Open h-enk opened this issue 4 years ago • 2 comments

Summary

Basic example

Motivation

  • https://github.com/h-enk/doks/discussions/120

h-enk avatar Feb 09 '21 09:02 h-enk

I am confused, why does getdoks.org already use algolia while this repo does not use it?

NicoHood avatar Feb 10 '21 23:02 NicoHood

@NicoHood see https://github.com/h-enk/doks/discussions/120 where we discuss this - I think the original motivation was to have a free search method but thoughts regarding search have changed recently.

teamcrisis avatar Feb 10 '21 23:02 teamcrisis

It looks like you're switching how search is provided in Doks, but I wanted to inquire about the current state. By default, it doesn't seem like flexsearch works in a freshly cloned repo. I've tried changing the variables (using "ALL", etc., in the config), but the indexing variable seems to have no effect on behavior (though the show one works). Is there a command or similar I'm missing that builds the index? Should I just roll my own here for now?

Thanks, enjoying Doks.

smythp avatar Aug 03 '23 21:08 smythp

No, I'm not switching. FlexSearch is the best search solution for static websites — in my opinion.

Not sure, why it doesn't work for you. Do you have a repository you could share?

Note, Doks v1.0 (available soon) will have more advanced options ( e..g select sections, taxonomies, and terms to index) and uses a smarter setup (e..g. using a JSON index file).

h-enk avatar Aug 14 '23 10:08 h-enk

The repo is here:

https://github.com/smythp/sigstore-docs-replatform

I've reenabled the search. The flex-related variables are set to empty lists, though I've gone through a number of permutations. Thank you for any guidance, I was going to set up another provider but I'd prefer to try to get the default for this theme working.

smythp avatar Aug 14 '23 16:08 smythp

It's an issue in the file that generates the index (it fails on a commented-out part).

Delete these lines and you're good to go!

https://github.com/smythp/sigstore-docs-replatform/blob/main/assets/js/index.js#L78-L94

h-enk avatar Aug 14 '23 19:08 h-enk

Henk, this worked like a charm. Thank you.

smythp avatar Aug 14 '23 19:08 smythp

Doks comes with FlexSearch preconfigured out of the box. If you want to use DocSearch in stead, this guide will explain how.

h-enk avatar Jan 08 '24 14:01 h-enk