title: Lucene QueryParser vs. TermQuery
body: <p>I'm currently unsure about the behavior of the QueryParser vs. TermQuery in Lucene; I'm using Lucene 3.6. </p>
  
  <p>In my example I'm try the following examples over the same index, where the field in question is set at <code>Field.Store.NO</code> and <code>Field.Index.NOT_ANALYZED_NO_NORMS</code>.</p>
  
  <pre><code>Query q1 = new TermQuery(new Term("names", "test three"));
  
  QueryParser q2p = new QueryParser(GenericIndexer.LUCENE_VERSION, "names", someAnalyzer);
  Query q2 = q2p.parse("names:test three");
  Query q3 = q2p.parse("names:\"test three\"");
  </code></pre>
  
  <p>In both cases <code>q2</code> and <code>q3</code> I'm unable to reproduce the same syntax as <code>q1</code>; by printing out the queries, I can see that: </p>
  
  <ul>
  <li>q1 = <code>names:test three</code></li>
  <li>q2 = <code>names:test names:three</code></li>
  <li>q3 = <code>names:"test three"</code></li>
  </ul>
  
  <p>Due to this difference queries <code>q2</code> and <code>q3</code> return no results, while query <code>q1</code> return the expected result. </p>
  
  <p><strong>Question</strong>: Is there a way to have the query parser to reproduce the same query as the TermQuery or am I missing some fundamental Lucene's notion here? </p>
  
  <p>Note: for the QueryParser, the analyzer is the same one used during indexing, although I'm not sure how relevant this information is. </p>