Efficiently String searching in Python
<p>Let's say I had a database of like 2,000 keywords, which each map to a few common variations </p>

<p>For example:</p>

<pre><code> "Node" : ["node.js", "nodejs", "node js", "node"] 

 "Ruby on Rails" : ["RoR", "Rails", "Ruby on Rails"]
</code></pre>

<p>and I want to search a string (ok, a document) and return a list of all the contained keywords.</p>

<p>I know I could loop through a ton of <code>regex</code> searches, but is there a more efficient way of doing this? something approximating "real time" or near-real time for a web app? </p>

<p>I am currently looking at <a href="https://github.com/elastic/elasticsearch" rel="nofollow">Elastic Search</a> document, but I want to know is there a <code>Pythonic</code> way to achieve my result. </p>

<p>I am pretty familiar with <code>regex</code> but I don't want to write so many regular expression now. I will appreciate your answers or if you can point me to right direction.</p>