## Apache Zeta Components Manual :: Docs For Class ezcSearchQueryBuilder

### Search::ezcSearchQueryBuilder

### Class ezcSearchQueryBuilder

ezcSearchQueryBuilder provides a method to add a natural language search query to an exisiting query object.

Source for this file: /Search/src/query_builder.php

Version: | //autogen//

### Method Summary

protected static array(ezcSearchQueryToken) | `tokenize( $searchQuery )` Tokenizes the search query into tokens
protected void | `buildQuery( $q , $tokens , $searchFields )` Walks over the $tokens and builds the query $q from them and the $searchFields
public void | `parseSearchQuery( $query , $searchQuery , $searchFields )` Parses the $searchQuery and adds the selection clauses to the $query object
public void | `reset( )` Resets the parser to its initial state.

### Methods

#### tokenize

static array(ezcSearchQueryToken) tokenize( string $searchQuery )

Tokenizes the search query into tokens

##### Parameters:

Name | Type | Description
--- | --- | ---
`$searchQuery` | string |

#### buildQuery

void buildQuery( ezcSearchQuery $q , array(ezcSearchQueryToken) $tokens , array(string) $searchFields )

Walks over the $tokens and builds the query $q from them and the $searchFields

##### Parameters:

Name | Type | Description
--- | --- | ---
`$q` | ezcSearchQuery |
`$tokens` | array(ezcSearchQueryToken) |
`$searchFields` | array(string) |

##### Exceptions:

Type | Description
--- | ---
`ezcSearchBuildQueryException` | if there is an uneven set of quotes.

#### parseSearchQuery

void parseSearchQuery( ezcSearchQuery $query , string $searchQuery , array(string) $searchFields )

Parses the $searchQuery and adds the selection clauses to the $query object

##### Parameters:

Name | Type | Description
--- | --- | ---
`$query` | ezcSearchQuery |
`$searchQuery` | string |
`$searchFields` | array(string) |

#### reset

void reset( )

Resets the parser to its initial state.

Documentation generated by phpDocumentor 1.4.3