Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Improve search for urls (titles, slugs)

Seems like search for urls behaves in a few ways that were surprising for me, to the point of seeming like a bug. I think these are both pretty straightforward to fix!

Context: I wanted to comment that search seems to be broken/buggy re urls. I tried to search for this url which I was sure I had on my paste history (https://slatestarcodex.com/2017/03/24/guided-by-the-beauty-of-our-weapons/) and the words “beauty” and “weapons” didn’t find it. After going and getting it from elsewhere, I then checked search again, and once again those words didn’t find it, but “guided” did. I have no reason to think that the search-matching is supposed to have to start at the beginning, since lots of other matches are in the middle. but seemingly, for urls (both titles and url itself) it matches only from the beginning.

Conclusion: it’s only matching the url itself, not the title of the url (even though that is shown). and then it’s treating guided-by-the-beauty-of-our-weapons like all one word and not matching in the middle. my suggestion is to fix both of those:

  • match the saved title of urls, not just the url itself
  • for urls, split slugs-with-hyphens-in-them into separate words for search indexing (though also allow matching hyphenated, eg “slugs-with”)
2 years ago
Changed the status to
Completed
6 months ago