bundler-site icon indicating copy to clipboard operation
bundler-site copied to clipboard

Replace middleman-search with lunr with Typesense DocSearch

Open tnir opened this issue 2 years ago • 10 comments

What was the end-user problem that led to this PR?

As middleman-search (RubyGems, GitHub) has not been maintained for more than 5.5 years (for example https://github.com/manastech/middleman-search/pull/38), bundler-site maintainers/contributors cannot upgrade lunr to the latest without their additional efforts (or other community's efforts than maintainers/contributors of this repo).

Closes #691

What was your diagnosis of the problem?

UI can be replaced by https://github.com/algolia/docsearch or its forks. Backend (current /search/lunr-index.json) can be replaced by Algolia DocSearch with automated crawling or Typesense cloud with manual crawling by us.

What is your fix for the problem, implemented in this PR?

  • Removes middleman-search gem and relevant gems (mini_racer)
  • Removes JS/CSS codes and Middleman configuration for middleman-search
  • Removes (the load of) Popover CSS from Bootstrap 5 along with the above JS code removal.
  • Also the load of /application.min.js is moved to outside of <head>.

A crawler (which is expected to run once a day in production) is currently run by my local.

A cloud project on Typesense cloud called k0cw8zgj4i592lsqp-1.a1.typesense.net is used.

Why did you choose this fix out of the possible options?

If Typesense offers us to some tiny instance at no cost and the permission to the UI, we might be able to use this change instead of Algolia's DocSearch.

Signed-off-by: Takuya Noguchi [email protected]

tnir avatar Jul 18 '22 07:07 tnir

So nice to get rid of the v8 too!

olleolleolle avatar Jul 18 '22 11:07 olleolleolle

Algolia alternative seems easier for now but I have to say I find this UI very nice looking.

deivid-rodriguez avatar Jul 19 '22 11:07 deivid-rodriguez

This looks fine performance wise, and the UI seems nice too. But the presence of a logo is a blocker and the majority of maintainers seem to prefer to take over middleman-search maintenance?

deivid-rodriguez avatar Jul 23 '22 10:07 deivid-rodriguez

This looks fine performance wise, and the UI seems nice too. But the presence of a logo is a blocker and the majority of maintainers seem to prefer to take over middleman-search maintenance?

indeed, let's focus on that one

simi avatar Jul 23 '22 11:07 simi

Features, look and feel are now all set. A small tweak in UI was submitted as a PR to the upstream, which is however NOT blocked to get this merged.

Any feedback is welcome again.

tnir avatar Jul 23 '22 12:07 tnir

@tnir You plan is unclear to me, since we don't have permission to go ahead without a logo. Everybody agrees to keep middleman-search for now.

deivid-rodriguez avatar Jul 23 '22 19:07 deivid-rodriguez

Just my previous comment was delayed. Just send back to draft at the moment while not sure this can be usable in the future.

tnir avatar Jul 23 '22 23:07 tnir

Ah, I see, makes sense now if comments are read in the right order :)

deivid-rodriguez avatar Jul 24 '22 08:07 deivid-rodriguez

By the way, another problem underlies in assets/javascripts/search.js. The hard way.

tnir avatar Jul 24 '22 09:07 tnir

I understand, but for now it seems our best option is to maintain these ~200 lines of JavaScript and this gem for searching...

deivid-rodriguez avatar Jul 24 '22 09:07 deivid-rodriguez