title: Lucene error while parsing Query: Cannot parse '': Encountered "<EOF>" at line 1, column 0
body: <p>I want to parse some text using Lucene query parser to carry out basic text preprocessing on the texts. I used following lines of code:</p>
  
  <pre><code>Analyzer analyzer = new EnglishAnalyzer();
  QueryParser parser = new QueryParser("", analyzer);
  String text = "...";
  String ret = parser.parse(QueryParser.escape(text)).toString();
  </code></pre>
  
  <p>But, I am getting an error:</p>
  
  <pre><code>Exception in thread "main" org.apache.lucene.queryparser.classic.ParseException: Cannot parse '': Encountered "&lt;EOF&gt;" at line 1, column 0.
  </code></pre>