Live data from Hacker News

Rules for Autocomplete

jeremymikkola.com

21–30 of 151 posts

Re: Rules for Autocomplete

#21
post #6

This is pretty interesting and useful. Now where are the details about how to get ElasticSearch to behave this way? :)

> Now where are the details about how to get ElasticSearch to behave this way?

The rules posted in the article make a lot of sense, but they also require a ton of backend work. To do prefix matches quickly, you need to create a new index of your content. Then to handle the relevance rules described, you need to be able to query both indices and merge the results in a meaningful way. No obvious way to do this with ES.

Re: Rules for Autocomplete

#22
post #19
post #17

Earlier quoted context omitted.

This is talking about search auto-completion and not spelling auto-correct.

Whoopsie. Caught cold turkey I admit. But for what it’s worth, for text editor and text message spelling autocorrect, auto detect would be nice, even if off-topic.

Actually autocomplete for each word might not be too bad. Just get a unique prefix or few letters in order and that's all you need.

Re: Rules for Autocomplete

#24
Agree with a lot of these, particularly the ones that prevent misclicks (changing the data "underneath you" when you have something else selected, or "enter" doing something unexpected).

However, strongly disagree with the sorting and preference guidelines. In general the autocomplete should match the intention of what the user is trying to accomplish which is going to vary widely depending on context. Sometimes that's the shortest lexical thing, sometimes geo matters, sometimes recency of usage matters, etc.

Re: Rules for Autocomplete

#25
post #20

> If an option is highlighted, never change it, even if new data is loaded. I'd change this to "never change the positions of already visible elements when the person is not typing". Typing something, then trying to click/tap on a result that disappears and gets replaced by something else is infuriating.

Ctrl-, (or Ctrl-T) in Visual Studio (...not VS Code) drives me nuts in this regard. It takes about 2-4 seconds before you can safely select an option without fearing it will be taken away by sleight of hand.

Re: Rules for Autocomplete

#26
post #20

> If an option is highlighted, never change it, even if new data is loaded. I'd change this to "never change the positions of already visible elements when the person is not typing". Typing something, then trying to click/tap on a result that disappears and gets replaced by something else is infuriating.

On Gboard every time I try to type the word "don't" I type d-o, see the suggestion in the middle, and start reaching for it while I press the "n"... only to have it type Don, the proper name of nobody in my contacts.

Re: Rules for Autocomplete

#27
One thing I didn't see here that's a big pet peeve of mine, if you're typing and the first option changes despite the first matching prefix not changing.

Re: Rules for Autocomplete

#28
Particularly twitter is a huge sinner in regards to autocomplete. When searching, autocomplete for profiles comes much faster than the autocomplete for search terms. Often bad timing makes me hover a profile and then right when I click the search terms autocomplete finishes and changes the data underneath me.

Re: Rules for Autocomplete

#29
post #7

here's my pet peeve: its the omnibox in google chrome. it only chooses prefix-lengthening matches if I am on guardian.co.uk/au I can find sub-spaces under this. I also visit guardian.co.uk/uk but I cannot be told about it by google omnibox rules. But, URL forms are syntactically bound, the /... is well understood to identify a base-URL and sister URLs. The stringmatch logic should show me at least some of my sisters…

The conspiracytheorist in me thinks Chrome's address bar is intenionally crippled to make you do a Google search instead. It's so so different from how well it works in Firefox.

It also breaks the rule in the article about not selecting the suggestion for you. When I start typing in Chrome it fills my whole bar with a suggested url that matches. I end up pressing esc to remove the last highlighted/completed part, but that ends up clearing the whole field. I do this multiple times a day, drives me nuts.

Re: Rules for Autocomplete

#30
Great list. I would add:

* Don’t automatically add the suggestion as selected text in the search box. Because pressing delete will delete (only) the auto-completed text, not the last character you typed (which is what you’d expect if you’re typing fast). The Chrome URL bar is an offender here.

Post reply on HN