Path

ez components / documentation / api reference / 2009.1 / search


eZ Components 2009.1

Search: ezcSearchQuery

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

Interface: ezcSearchQuery

Class to create select search backend indepentent search queries. [source]

Descendents

Child Class Description
ezcSearchDeleteQuery Class to create select search backend indepentent search queries.
ezcSearchFindQuery Class to create select search backend indepentent search queries.

Method Summary

public ezcSearchQuery __construct( $handler, $definition )
Creates a new search query with handler $handler and document definition $definition.
public string between( $field, $value1, $value2, $value2 )
Returns a string containing a field/value specifier, and an optional boost value.
public string boost( $clause, $boostFactor )
Modifies a clause to give it higher weight while searching.
public string eq( $field, $value, $value )
Returns a string containing a field/value specifier, and an optional boost value.
public ezcSearchQuery facet( $facet )
Adds one facet to the query.
public string fuzz( $clause, [$fuzzFactor = null] )
Modifies a clause make it fuzzy.
public string important( $clause )
Creates an 'important' clause
public string lAnd( $... )
Creates an AND clause
public ezcSearchQuery limit( $limit, [$offset = 0] )
Registers from which offset to start returning results, and how many results to return.
public string lOr( $... )
Creates an OR clause
public string not( $clause )
Creates a NOT clause
public ezcSearchQuery orderBy( $column, [$type = ezcSearchQueryTools::ASC] )
Tells the query on which field to sort on, and in which order
public void reset( )
Resets the query object for reuse.
public ezcSearchQuery where( $clause )
Adds a select/filter statement to the query

Methods

__construct

ezcSearchQuery __construct( ezcSearchHandler $handler, ezcSearchDocumentDefinition $definition )
Creates a new search query with handler $handler and document definition $definition.

Parameters

Name Type Description
$handler ezcSearchHandler  
$definition ezcSearchDocumentDefinition  

between

string between( string $field, mixed $value1, $value2, mixed $value2 )
Returns a string containing a field/value specifier, and an optional boost value.
The method uses the document definition field type to map the fieldname to a solr fieldname, and the $fieldType argument to escape the values correctly.

Parameters

Name Type Description
$field string  
$value1 mixed  
$value2 mixed  
$value2  

boost

string boost( string $clause, float $boostFactor )
Modifies a clause to give it higher weight while searching.
This method accepts a clause and adds a boost factor.

Parameters

Name Type Description
$clause string  
$boostFactor float  

eq

string eq( string $field, $value, mixed $value )
Returns a string containing a field/value specifier, and an optional boost value.
The method uses the document definition field type to map the fieldname to a solr fieldname, and the $fieldType argument to escape the $value correctly. If a definition is set, the $fieldType will be overridden with the type from the definition.

Parameters

Name Type Description
$field string  
$value mixed  
$value  

facet

ezcSearchQuery facet( string $facet )
Adds one facet to the query.

Parameters

Name Type Description
$facet string  

fuzz

string fuzz( string $clause, [float $fuzzFactor = null] )
Modifies a clause make it fuzzy.
This method accepts a clause and registers it as a fuzzy search, an optional fuzz factor is also supported.

Parameters

Name Type Description
$clause string  
$fuzzFactor float  

important

string important( string $clause )
Creates an 'important' clause
This method accepts a clause and marks it as important.

Parameters

Name Type Description
$clause string  

lAnd

string lAnd( mixed $... )
Creates an AND clause
This method accepts either an array of fieldnames, but can also accept multiple parameters as field names.

Parameters

Name Type Description
$... mixed  

limit

ezcSearchQuery limit( int $limit, [int $offset = 0] )
Registers from which offset to start returning results, and how many results to return.
$limit controls the maximum number of rows that will be returned. $offset controls which row that will be the first in the result set from the total amount of matching rows.

Parameters

Name Type Description
$limit int  
$offset int  

lOr

string lOr( mixed $... )
Creates an OR clause
This method accepts either an array of fieldnames, but can also accept multiple parameters as field names.

Parameters

Name Type Description
$... mixed  

not

string not( string $clause )
Creates a NOT clause
This method accepts a clause and negates it.

Parameters

Name Type Description
$clause string  

orderBy

ezcSearchQuery orderBy( string $column, [int $type = ezcSearchQueryTools::ASC] )
Tells the query on which field to sort on, and in which order
You can call orderBy multiple times. Each call will add a column to order by.

Parameters

Name Type Description
$column string  
$type int  

reset

void reset( )
Resets the query object for reuse.

where

ezcSearchQuery where( string $clause )
Adds a select/filter statement to the query

Parameters

Name Type Description
$clause string  

Last updated: Mon, 29 Jun 2009