Open Sainan opened 2 years ago
Thanks for your suggestion,
I agree that the search algorithm could use some improvements, but this feels like a bandaid fix. I think a proper fuzzy search implementation would be preferable (fusejs perhaps?). I'm not exactly sure how this should be reflected in the UI, as the ranking of results is quite an essential aspect of such an approach. This change in UI could also be relevant for #8.
I'll look into it further once I get back from vacation.
I don't know about "bandaid", I've looked at the problem of search matching quite a bit, and I find this to be more natural than fuzzy search. Tho I haven't bothered with ordering results.
What I meant with it being a bit of a bandaid solution is that it only addresses one shortcoming.
For example, I'd like a search for “vehicle color” to yield VEHICLE_COLOUR
natives too.
I do think it is good to not return a result if it would be a typo, as you do get some undesirable & illogical results, which is why I said I don't like the fuzzy approach.
Maybe a trivial algorithm to normalise the English dialect could solve this issue?
as you do get some undesirable & illogical results, which is why I said I don't like the fuzzy approach.
That's why I mentioned that the ranking of results is important. Having the most exact matches rank higher should mostly eliminate your concern. However, one issue with this approach is that it would be difficult to show the namespace boundaries...
I'll do some experimenting on what feels most natural.
I suppose so, but I think this UI redesign is a bit of a burden on you, so just using 1 or 2 simple algorithms could improve search by a lot for not much work.
I have "temporarily" implemented your original suggestion in this commit as I'm unlikely to do the fuzzy search any time soon.
I'm still planning on doing it, but it has been moved to the "soon™" bucket.
Right now, putting a space into the search query basically guarantees you won't get results, so it would be good to repurpose it as a separator for multiple keywords, giving queries such as "player from ped" a chance to return the respective native.
An example implementation: