Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcSearchFindQuery

Search::ezcSearchFindQuery

Interface ezcSearchFindQuery

Class to create select search backend indepentent search queries.

Source for this file: /Search/src/interfaces/query_find.php

ezcSearchQuery
   |
   --ezcSearchFindQuery
Version:   //autogentag//

Method Summary

public string boost( $clause , $boostFactor )
Modifies a clause to give it higher weight while searching.
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 ezcSearchQuery limit( $limit , [ $offset = 0] )
Registers from which offset to start returning results, and how many results to return.
public ezcSearchQuery orderBy( $column , [ $type = ezcSearchQueryTools::ASC] )
Tells the query on which field to sort on, and in which order
public ezcSearchFindQuery select( $... )
Opens the query and selects which fields you want to return with the query.

Inherited Methods

From ezcSearchQuery
public ezcSearchQuery ezcSearchQuery::__construct()
Creates a new search query with handler $handler and document definition $definition.
public string ezcSearchQuery::between()
Returns a string containing a field/value specifier, and an optional boost value.
public string ezcSearchQuery::eq()
Returns a string containing a field/value specifier, and an optional boost value.
public string ezcSearchQuery::lAnd()
Creates an AND clause
public string ezcSearchQuery::lOr()
Creates an OR clause
public string ezcSearchQuery::not()
Creates a NOT clause
public void ezcSearchQuery::reset()
Resets the query object for reuse.
public ezcSearchQuery ezcSearchQuery::where()
Adds a select/filter statement to the query

Methods

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

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

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

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

select

ezcSearchFindQuery select( string|array(string) $... )

Opens the query and selects which fields you want to return with the query.

select() accepts an arbitrary number of parameters. Each parameter must contain either the name of a field or an array containing the names of the fields. Each call to select() appends fields to the list of fields that will be used in the query.

Example:

  1.  $q->select( 'field1', 'field2' );
The same could also be written:
  1.  $fields[] = 'field1';
  2.  $fields[] = 'field2;
  3.  $q->select( $fields );
or using several calls
  1.  $q->select( 'field1' )->select( 'field2' );
Parameters:
Name Type Description
$... string|array(string) Either a string with a field name or an array of field names.
Documentation generated by phpDocumentor 1.4.3