Path

ez components / documentation / api reference / 2009.1 / search


eZ Components 2009.1

Search: ezcSearchQueryBuilder

[ Tutorial ] [ Solr schema ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcSearchQueryBuilder

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

Method Summary

protected void buildQuery( $q, $tokens, $searchFields, $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.
protected static array(ezcSearchQueryToken) tokenize( $searchQuery )
Tokenizes the search query into tokens

Methods

buildQuery

void buildQuery( ezcSearchQuery $q, array(ezcSearchQueryToken) $tokens, $searchFields, 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)  
$searchFields  

Throws

ClassDescription
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.

tokenize

array(ezcSearchQueryToken) tokenize( string $searchQuery )
Tokenizes the search query into tokens

Parameters

Name Type Description
$searchQuery string  

Last updated: Mon, 29 Jun 2009