Evaluating options for static site searching.

Tony Atkins tony at raisingthefloor.org
Tue Apr 30 09:46:13 UTC 2019


Hi, All.

I have submitted a pull request to add a search to the Infusion docs static
site:

https://github.com/fluid-project/infusion-docs/pull/147

Fuse.js turned out to be fairly reasonable, although I did have to adjust
its settings.  The defaults favour early matches, even if they are of lower
quality.  I increased the allowed "distance from beginning" and the
strictness of the match, which seemed to work well, and was decently fast
(< 75ms for all searches I've tried).  I also was not quite as happy with
the "match indices" Fuse.js provides to highlight matches in context.
Sometimes those are low value matches like 2-3 character partial word
matches or even empty strings.  I ended up filtering for the longest match,
which seemed to work reasonably well.

The "pregenerated search digest" approach I outlined in the review worked
well.  Since the Infusion docs have linkable headings, I broke down each
page into sub-headings, and then grouped the results by page.  This will
hopefully help with very long docs like our Core API docs, where a link to
the nearest header is especially helpful.

Anyway, while it's under review, if you're interested, you can try it out
by:

   1. Checking out the branch associated with the pull.
   2. Running npm install
   3. Running npm run docpad.
   4. Opening the docpad URL in a browser.

Feel free to comment here or on the pull if you have questions, concerns or
ideas.

Cheers,


Tony

On Thu, 11 Apr 2019 at 10:06, Tony Atkins <tony at raisingthefloor.org> wrote:

> Thanks, Alan.
>
> It's a fair point about DocPad integration, and it's really good to have
> an idea of how well each might work with its replacement.  I only see Fuse
> in the example you shared, but a quick search brought me to the relevant
> page in the Hugo docs <https://gohugo.io/tools/search/>, and there are
> certainly options for either Fuse.js or Lunr.js (that page links to the
> page you shared, BTW).
>
> Cheers,
>
>
> Tony
>
> On Wed, 10 Apr 2019 at 19:02, Harnum, Alan <aharnum at ocadu.ca> wrote:
>
>> Hi Tony,
>>
>>
>>
>> Thank you for this summary – as discussed in the channel yesterday, I
>> personally don’t consider DocPad integration to be a compelling reason for
>> a particular solution. Philosophically speaking, the last few years of
>> experience has made me distrustful of plugin-style architectures for static
>> site generation (this is very coloured by the recent DocPad struggles).
>>
>>
>>
>> There are a few examples of integrating both Fuse and Lunr with Hugo (the
>> direction the IDRC has been going lately for static sites) here that may
>> usefully inform this discussion:
>> https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae
>>
>>
>>
>> *From: *fluid-work <fluid-work-bounces at lists.idrc.ocad.ca> on behalf of
>> Tony Atkins <tony at raisingthefloor.org>
>> *Date: *Wednesday, April 10, 2019 at 10:45 AM
>> *To: *"architecture at lists.gpii.net Architecture" <
>> architecture at lists.gpii.net>, Fluid Work <fluid-work at fluidproject.org>
>> *Subject: *Evaluating options for static site searching.
>>
>>
>>
>> Hi, All.
>>
>>
>>
>> This week I took a few minutes to evaluate a few options for searching
>> static sites (like the Infusion documentation) and wrote up my experiences
>> as a technology evaluation on the GPII wiki:
>>
>>
>>
>> https://wiki.gpii.net/w/Technology_Evaluation_-_Static_Site_Search
>>
>>
>>
>> As this issue affects both the Fluid community and the GPII architecture
>> that is largely built using Infusion, I'm cross-posting to the
>> gpii-architecture and fluid-work mailing lists to get input from both
>> communities.  If you are at all interested in the topic, I'd appreciate it
>> if you'd take a few minutes to review the evaluation and send your feedback.
>>
>>
>>
>> If there is enough interest, I am happy to put together a one-off meeting
>> to discuss.
>>
>>
>>
>> Cheers,
>>
>>
>>
>>
>>
>> Tony
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.idrc.ocad.ca/pipermail/fluid-work/attachments/20190430/97ab980b/attachment.htm>


More information about the fluid-work mailing list