stacker.news
stacker.news copied to clipboard
Exclude apostrophe used as possessive when finding matches for Search indexing
If a word in a post or comment includes an apostrophe, but no apostrophe is used in the search criteria, content with that word will not match.
Example: Search criteria: doctor The content with "doctor's office" will not be included in the search results.
But ignoring everything after the apostrophe will introduce a problem though where the apostrophe is used as a contraction (don't) or as a substitute for a diacritical (e.g., O'leary), or for whatever other reason apostrophes are used. So perhaps all that is needed is to strip the apostrophe (and character that follows) only when used as a possessive ('s).
https://en.wikipedia.org/wiki/Apostrophe https://en.wikipedia.org/wiki/Possessive
Can you add an example of search where this occurs on the site? I suspect these was a search in particular that prompted this.
https://stacker.news/items/33903 Search criteria "Doctor's" finds it. Search criteria "Doctor" does not -- at least not like if the title of the post had "doctor" without the apostrophe.
Another example: https://stacker.news/items/34086 Search criteria: "Kenya's" returns the results I would expect to see (i.e., item 34086 at the top or near it). But with search criteria of just "Kenya", that item isn't even in the top 10 results.