Let’s begin with some history.
Lucene 4.7.0 introduced a new query parser, the
SimpleQueryParser, presented as a "parser for human-entered queries". The point of this parser is to be a very simple lenient state machine to parse queries entered by your end users.
The parser is capable to transform
keyword "some phrase" -keywordidontwant fuzzy~ prefix* into a Lucene query, giving your users a little more power (phrase queries, fuzzy queries, boolean operators…). The lenient part is important as it will try to build the best possible query without throwing a parse exception, even if the query is not what we would consider syntactically correct.
Another nice feature is that it allows to search on multiple fields. You basically end up establishing the following contract with Lucene:
users will enter a search query (more or less syntactically correct)
it will search on the fields you have specified (and you can also specify a specific boost for each field)
you can enable each of the features that you want to expose to the users (i.e. you can enable the phrase queries but not the boolean operators)
building the query won’t throw an exception
So, what is a Simple Query String for us? Just a string following the
SimpleQueryParser syntax or, in user terms, what the user entered in the search box.