Skip to content

Add possible search implementation - #62

Open
CoderMuffin wants to merge 6 commits into
SRCF:masterfrom
CoderMuffin:add-search
Open

Add possible search implementation#62
CoderMuffin wants to merge 6 commits into
SRCF:masterfrom
CoderMuffin:add-search

Conversation

@CoderMuffin

Copy link
Copy Markdown
Contributor

Add a possible implementation for searching.

Potential issues:

  • Can't reorder search terms - they must appear in the same order as the document
  • Search may be a little too permissive in some cases (allows partial matches of 3+ characters in the middle of words)
  • Search performance is a little slow for long queries
this aligns it to be in a similar position to the one on home page, hopefully preventing "where's the search bar gone"
Comment thread layouts/index.json Outdated
@CoderMuffin
CoderMuffin force-pushed the add-search branch 2 times, most recently from 07f6f49 to daec9ec Compare March 29, 2026 12:36

@rsa33 rsa33 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this builds and seems to work -- the matching is a little funky (e.g. typing an extra character sometimes produces more results rather than narrowing) but generally surfaces useful pages, which I think is a huge improvement over a lack of search.

The latency on long queries is a bit rough though. Whilst I'd expect most people not to write too much here, pasting errors and the like may make it noticeable. A quick look around online led me to flexsearch and its benchmark page which suggests fuse might be one of the slowest libraries. 😅 Is it worth trying a different one?

Comment thread static/css/style.css Outdated
Comment thread static/js/search.js
boost: 1
},
{
field: "heading-title-tolerant",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be able to remove these? can't seem to get a meaningful difference in results with/without them - I think suggest: true might cover the same case

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

Labels

None yet

2 participants