title: Searching dataset by multiple tags
body: <p>Maybe the title of this question is a little bit odd because I simply have no idea what I'm looking for.</p>
  
  <p>I have some data e.g. a string and multiple tags associated with it. Now I would like to have the ability to search through my data with a string.</p>
  
  <blockquote>
    <p>Edit: <strong>The Problem is not the string comparison or the substring
    search!</strong> The Problem is the connection from the result to the data
    object.</p>
  </blockquote>
  
  <p>Here a Movie example:</p>
  
  <pre><code>"Title1" tags: "genre1" "genre2" "actor1" "actor2"
  "Title2" tags: "genre2" "actor2" "actor3"
  "Title3" tags: "genre2" "genre3" "actor1" "actor3"
  
  Search for "genre2" -&gt; "Title1", "Title2", "Title3"
  Search for "Title1" -&gt; "Title1"
  Serach for "actor1" -&gt; "Title1", "Title3"
  </code></pre>
  
  <p>Other examples: </p>
  
  <ul>
  <li>YouTube: Search for a Video ... </li>
  <li>Amazon: Search for "tv" but "tv" does not have to be in the title.</li>
  </ul>
  
  <p>The only thing in my mind is a multimap pointing to a list of all possibilities. Then I have to compare the search string with all keys and tada. But I can not believe that this is a good solution because I would have an insane amount of lists...</p>
  
  <p>Can anyone give me an idea of what I'm looking for and maybe how I can implement this? I use c++ with Qt. I don't know if Qt could help me in any way.</p>
  
  <p><strong>Edit:</strong> I could add all keyword together like this:</p>
  
  <pre><code>"Title1 genre1 genre2 actor1 actor2"
  "Title2 genre2 actor2 actor3"
  "Title3 genre2 genre3 actor1 actor3"
  </code></pre>
  
  <p>Create a map with this key to the data object. Then I only have to do a string search and get all strings where the search string is a substring of the key.</p>
  
  <p>But is this a good solution? What if I want to prioritize a match in the title?</p>