title: MongoDB - how store/search word tokens?
body: <p>I want to store and search human names, which might consist of two tokens and search for one should produce the result. So if you have &quot;Arthur Conan&quot;, search for &quot;arthur&quot; would be a hit.</p>
  <p>Question: how should I store the normalized name (in addition to original display name)?</p>
  <ul>
  <li>as a string &quot;arthur conan&quot; =&gt; query would use a regex (one where &quot; arthur&quot;, &quot;arthur&quot; and &quot;arthur &quot; would be a hit)</li>
  <li>or each name part as an element in an array, e.g. <code>[&quot;arthur&quot;, &quot;conan&quot;]</code> =&gt; simple <code>find({firstName: [&quot;arthur&quot;]})</code>.</li>
  </ul>
  <p>Which way is more flexible/efficient? Can I sort the collection by an array-type or would I need the normalized name as one string anyway?</p>
  <p>Would the use-case change if I wanted to search a free text (The quick brown fox jumps over the lazy dog) =&gt; &quot;lazy dog&quot; should be a hit, &quot;dog lazy&quot; should be not, or with a lower score...</p>