Search/Lucene/Search/QueryParser.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Search_Lucene
- Subpackage
- Search
- Version
- $Id$
\Zend_Search_Lucene_Search_QueryParser
Package: Zend_Search_Lucene\Search












Abstract Finite State Machine
Take a look on Wikipedia state machine description: http://en.wikipedia.org/wiki/Finite_state_machine
Any type of Transducers (Moore machine or Mealy machine) also may be implemented by using this abstract FSM.
process() methods invokes a specified actions which may construct FSM output.
Actions may be also used to signal, that we have reached Accept State
- Parent(s)
- \Zend_Search_Lucene_FSM
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

integer $_defaultOperator = self::B_ORDefault boolean queries operator
Default value
self::B_ORDetails- Type
- integer

\Zend_Search_Lucene_Search_QueryParser $_instance = nullstatic
Parser instance
Default value
nullDetails
\Zend_Search_Lucene_Search_QueryToken $_lastToken = nullLast token
It can be processed within FSM states, but this addirional state simplifies FSM
Default valuenullDetails
boolean $_suppressQueryParsingExceptions = trueDefines query parsing mode.
If this option is turned on, then query parser suppress query parser exceptions
and constructs multi-term query using all words from a query.
That helps to avoid exceptions caused by queries, which don't conform to query language,
but limits possibilities to check, that query entered by user has some inconsistencies.
Default is true.
Use {@link Zend_Search_Lucene::suppressQueryParsingExceptions()},
{@link Zend_Search_Lucene::dontSuppressQueryParsingExceptions()} and
{@link Zend_Search_Lucene::checkQueryParsingExceptionsSuppressMode()} to operate
with this setting.
Default valuetrueDetails- Type
- boolean
Methods

_getInstance() : \Zend_Search_Lucene_Search_QueryParserstatic
Get query parser instance
Returns
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Search_QueryParser |

closedRQLastTerm() : voidProcess last range query term (closed interval)
Throws
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Search_QueryParserException |

escape(string $keyword) : stringstatic
Escape keyword to force it to be parsed as one term
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $keyword | string |
| Type | Description |
|---|---|
| string |

openedRQLastTerm() : voidProcess last range query term (opened interval)
Throws
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Search_QueryParserException |

parse(string $strQuery, string $encoding = null) : \Zend_Search_Lucene_Search_Querystatic
Parses a query string
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $strQuery | string | |
| $encoding | string |
| Type | Description |
|---|---|
| \Zend_Search_Lucene_Search_Query |
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Search_QueryParserException |

processModifierParameter() : voidProcess modifier parameter
Throws
| Exception | Description |
|---|---|
| \Zend_Search_Lucene_Exception |

queryParsingExceptionsSuppressed() : booleanstatic
Check 'suppress query parser exceptions' mode.
Returns
| Type | Description |
|---|---|
| boolean |

setDefaultEncoding(string $encoding) : voidstatic
Set query string default encoding
Parameters
| Name | Type | Description |
|---|---|---|
| $encoding | string |

setDefaultOperator(integer $operator) : voidstatic
Set default boolean operator
Parameters
| Name | Type | Description |
|---|---|---|
| $operator | integer |