Hacker News new | past | comments | ask | show | jobs | submit login

I think that's making it too hard. Where is this information coming from? How do you update it?

Instead, just order the matches like so:

1. Everything that matches at the first word 2. Everything that matches at the start of some word 3. Everything that matches at a non-start position within a word

Granted, in this scheme Cameroon will still show up before Canada, but you don't have to look anywhere near as hard to find it. I doubt anyone would notice/care about your "non-PC rating scheme", but I do know it would be a much bigger pain in the ass to maintain.




Compromise is the key. Use the idea, but keep it simple. Just pick a fixed list of relatively more likely countries, say the top 20 as defined by the G20. This extends and improves the traditional country selector which gives special status to 1 country (the USA) rather than 20. If you think a list of 20 needs to be more dynamic, why is it okay for the legacy list of 1 to be static ?


This is a good suggestion - I believe prefix match should weigh more than partial infix match.

As for "too complicated" - I am not suggesting to extract GDP or population data in Javascript. But in static HTML on server side you may add additional "weight" attribute to each option, the way alternative spellings are added (look at the HTML source). And then you may manage these weights externally.


I believe prefix match should weigh more than infix match... except for countries that start with an article (The Philippines, The Netherlands) where infix match works better. The Netherlands is now number 11 on the list after typing "Ne".


Doesn't mean you can't sub-sort within those categories.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: