title: Handling Lucene query parser errors
body: <p>My application takes a user inputted string and tries to parse it with the Lucene query parser. I noticed however that there are several formats of strings that provoke an error in this query parser.<br>
  e.g.:</p>
  
  <ul>
  <li>~anystring</li>
  <li>anystring +</li>
  </ul>
  
  <p>First I tried molding my user inputted string so that it could not contain these cases, but as I see it, there could be more cases I do not foresee now.</p>
  
  <p>How do you handle Query parser exceptions? How do you prevent them?</p>