kudrykv / alfred-craftdocs-searchindex

Note searching for Craft Docs
28 stars 2 forks source link

Add support for searching inside multiple spaces #3

Closed mafredri closed 2 years ago

mafredri commented 2 years ago

This PR adds support for searching in multiple spaces.

One limitation is that the original 40 result limit is kept and no smarts are applied to try to pick the most relevant result(s). For this reason the secondary space results are simply appended after primary space results and may not show up at all if the primary space has >40 results.

Since search index for spaces are named as follows:

I've relied on the os.ReadDir sort to guarantee that the "primary" space results are first.

Edit: I also opted not to parallelize the search of multiple spaces for V1 of this PR, a followup PR could improve upon the performance.

kudrykv commented 2 years ago

Thank you for your contribution! I will review the PR in the following days.