Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For thousands of items, do you even need one?


For typo resistance and stemming it’s useful. Mostly it depends if your search matching logic needs to do allocation per document, like if you need to concatenate 10 strings together to get the complete search text and then split that into some kind of stem array, doing that O(thousands) of times per keystroke can be laggy in JS especially on memory constrained devices because GC pressure. Better to do it once up front. Then voila, you’ve got an index.




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

Search: