docnix icon indicating copy to clipboard operation
docnix copied to clipboard

Search orders results confusingly

Open iFreilicht opened this issue 1 year ago • 1 comments

See this example:

Screenshot 2023-11-07 at 10 39 19

I am searching for "optionals", and there is lib.optionals that matches this search exactly, but it is not the first result or even on the first page.

iFreilicht avatar Nov 07 '23 09:11 iFreilicht

I guess we need to optimize the search for typical nix user expectations.

I think "lib.optionals" is seen by the search as one word if you search for "optionals" the levenstein distance to "optional" is much closer than to "lib.optionals". We need to change the default search indexing and introduce word splitting for the tokenizer at the (.) dot and also apply some weights for the last part of the string.

So lib.optionals is tokenized into [lib optionals] with a higher weight on "optionals".

hsjobeki avatar Nov 07 '23 09:11 hsjobeki