title: Lucene: build a query by tokenizing a string and pass
body: <p>I need to extract single terms from a string to build a query using <code>BooleanQuery</code>.
  I'm using <code>QueryParser.parse()</code> method for it, this is my code snippet:</p>
  
  <pre class="lang-java prettyprint-override"><code>booleanQuery.add(
      new QueryParser(
              org.apache.lucene.util.Version.LUCENE_40, 
              "tags", 
              new WhitespaceAnalyzer(org.apache.lucene.util.Version.LUCENE_40)
      ).parse("tag1 tag2 tag3"), 
      BooleanClause.Occur.SHOULD);
  </code></pre>
  
  <p>I'm however wondering if this is correct way to pass single terms to booleanQuery.</p>
  
  <p><code>QueryParser.parse</code> method returns a <code>SrndQuery</code> object, which I directly pass to <code>booleanQuery.add()</code> method.</p>
  
  <p>Not sure if this is correct. Should I extract single terms instead from <code>SrndQuery</code>... or something like that, and invoke <code>booleanQuery.add()</code> several times ?</p>
  
  <p><strong>Update</strong>: printed query</p>
  
  <pre><code>*.*:*.* title:Flickrmeetup_01 description:Michael description:R. description:Ross tags:rochester tags:ny tags:usa tags:flickrmeetup tags:king76 tags:eos350d tags:canon50mmf14 tags:mikros tags:canon tags:ef tags:50mm tags:f14 tags:usm tags:canonef50mmf14 tags:canonef50mmf14usm
  </code></pre>