CodeSpent / phanford.dev

My personal site, portfolio, blog, and sandbox.
https://phanford.dev/
3 stars 1 forks source link

Improve Article Indexing #1

Closed CodeSpent closed 1 year ago

CodeSpent commented 2 years ago
[{
  content: 'I like chicken nuggets'
},]

An index for the array above would return 0 results for the query c but 1 result for ch. Even though ch must contain the initial query c, the structure of Lunr's index will not suffice to produce better results.

I've spoken with CrutchCorn whose work is the current blog implementation's basis, who said the justification for sticking with Lunr's indexing is due to other indexing options bloating their bundle to 1-4+ MB.

I'd like to investigate more into how indexing can be improved for the current implementation.

crutchcorn commented 2 years ago

You can see some of my previous work with indexing on integrating with flexsearch in this commit:

https://github.com/unicorn-utterances/unicorn-utterances/pull/289/commits/ba1ba1739e03f3eca13861f9fec8ef0a7bc90a5d

I believe this bundle size was only ~1MB, but that's still really high.

Honestly, since we're using NextJS, it's highly suggested to migrate to using server-side searching instead of client-side search

CodeSpent commented 1 year ago

Indexing concern addressed with transition to contentlayer-dev.