title: (Wordpress + Autocomplete) Search for tags and get a list of all posts for searched tag?
body: <p>I'm trying to build a wordpress search with a customized <a href="http://jqueryui.com/autocomplete/" rel="nofollow">autocomplete</a> suggestion list. I want to restrict the search to tags only and if the user types in a search query that fits any of the tags or multiple tags, the autocomplete list should return all posts, associated with this/these tag(s).</p>
  
  <p>For example, typing in "Jazz" could give:</p>
  
  <pre><code>Jazz
    Post 1
    Post 2
    Post 3
    Post 4
    Post 5
  
  Jazz House
    Post 1
    Post 2
    Post 3
  
  Great Jazz Trio
    Post 1
  
  …
  </code></pre>
  
  <p>There is one autocomplete <a href="http://jqueryui.com/autocomplete/#categories" rel="nofollow">example, working with categories</a>. That might lead in the right direction, but here the search queries are the "posts" which will be listed under their categories. I'd need the user to search the categories (tags) to list all posts, associated with them.</p>
  
  <p>I thought it might be possible to create an array of objects of all tags. And each object (tag) could contain all related posts. This array could serve as data-source for the autocomplete.</p>
  
  <p>I'd be happy about any suggestions on how to approach that.</p>