Lucene supports single and multiple character wildcard searches within single terms (but not within phrase queries).
To perform a single character wildcard search use the "?" symbol.
To perform a multiple character wildcard search use the "*" symbol.
The single character wildcard search looks for string that match the term with the "?" replaced by any single character. For example, to search for "text" or "test" you can use the search:
Multiple character wildcard searches look for 0 or more characters when matching strings against terms. For example, to search for test, tests or tester, you can use the search:
You can use "?", "*" or both at any place of the term:
It searches for "write", "wrote", "written", "rewrite", "rewrote" and so on.
Starting from ZF 1.7.7 wildcard patterns need some non-wildcard prefix. Default prefix length is 3 (like in Java Lucene). So "*", "te?t", "*wr?t*" terms will cause an exception .
It can be altered using
Please note, that it's not a
Zend_Search_Lucene_Search_QueryParserException, but a
Zend_Search_Lucene_Exception. It's thrown during query
rewrite (execution) operation.