(written assuming that no outside services should be used, so no Solr or Elastic Search)
Just quickly - how I would NOT implement text search in Rails: using Active Record/SQL queries to comb the DB Articles for matches. That's expensive and slow.
My initial (pre-research) response for how to implement a custom text search feature would be to use a trie. One of my past Ruby projects was an autocomplete program using an n-array trie that was loaded with the full dictionary (each node was a letter and contained a flag to indicate the end of a word). Of course, for a text search we would need to search Upworthy's content for strings matching the input instead of suggesting words.
The way I imagine this working is, as articles are loaded into the trie, the node that completes each word is flagged with the article's ID. Words in an article headline could use an additional flag that carries more weight, as having 'cat' in the headline suggests the article is about cats, vs coincidentally being mentioned in the text of an article that may really be about something else.
A submitted search term could be fed into the trie, which would return all article ID's that are flagged at that point. The results could be sorted by amount/weight of flags associated with each article. The response would be quick, even if a massive amount of articles were loaded into the trie, as the growth of complexity in the trie slows over time (but article ID flags would accumulate linearly). It would be helpful to filter out low-value stops words that are found in a blacklist (array, regex, etc.).
After researching the topic of text-search data structures, a trie still seems like a good choice. There are more specialized versions that would be more efficient, like a suffix trie, which compresses single nodes, instead storing them as index ranges in one node. An inverted index could be used to map words to articles, which helps with prefix searching.
Given this one hour of time to write/research, I would aim to implement a trie structure, which I'm already familiar with, but to increase performance by learning how to compress nodes and use an inverted index (two things I've not implemented before). If a synonym search was required, I would imagine using a gem (Dinosaurus) or API to grab synonyms and perform text searches in the trie on those terms as well (although a different data structure might be better suited if synonym searching is required).