category Zend
package Zend_Search_Lucene
subpackage Search
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Print a query

__toString() : string

Returns

string

Constructs an appropriate Weight implementation for this query.

createWeight(\Zend_Search_Lucene_Interface $reader) : \Zend_Search_Lucene_Search_Weight

Parameters

$reader

\Zend_Search_Lucene_Interface

Returns

\Zend_Search_Lucene_Search_Weight

Execute query in context of index reader It also initializes necessary internal structures

execute(\Zend_Search_Lucene_Interface $reader, \Zend_Search_Lucene_Index_DocsFilter|null $docsFilter = null

Query specific implementation

Parameters

$reader

\Zend_Search_Lucene_Interface

$docsFilter

\Zend_Search_Lucene_Index_DocsFilternull

Gets the boost for this clause. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by boost. The boost is 1.0 by default.

getBoost() : float

Returns

float

Return query terms

getQueryTerms() : array

Returns

array

Highlight matches in $inputHTML

highlightMatches(string $inputHTML, string $defaultEncoding = '', \Zend_Search_Lucene_Search_Highlighter_Interface|null $highlighter = null) : string

Parameters

$inputHTML

string

$defaultEncoding

string

HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.

$highlighter

\Zend_Search_Lucene_Search_Highlighter_Interfacenull

Returns

string

Highlight matches in $inputHtmlFragment and return it (without HTML header and body tag)

htmlFragmentHighlightMatches(string $inputHtmlFragment, string $encoding = 'UTF-8', \Zend_Search_Lucene_Search_Highlighter_Interface|null $highlighter = null) : string

Parameters

$inputHtmlFragment

string

$encoding

string

Input HTML string encoding

$highlighter

\Zend_Search_Lucene_Search_Highlighter_Interfacenull

Returns

string

Get document ids likely matching the query

matchedDocs() : array

It's an array with document ids as keys (performance considerations)

Returns

array

Optimize query in the context of specified index

optimize(\Zend_Search_Lucene_Interface $index) : \Zend_Search_Lucene_Search_Query

Parameters

$index

\Zend_Search_Lucene_Interface

Returns

\Zend_Search_Lucene_Search_Query

Reset query, so it can be reused within other queries or with other indeces

reset() 

Re-write query into primitive queries in the context of specified index

rewrite(\Zend_Search_Lucene_Interface $index) : \Zend_Search_Lucene_Search_Query

Parameters

$index

\Zend_Search_Lucene_Interface

Returns

\Zend_Search_Lucene_Search_Query

Score specified document

score(integer $docId, \Zend_Search_Lucene_Interface $reader) : float

Parameters

$docId

integer

$reader

\Zend_Search_Lucene_Interface

Returns

float

Sets the boost for this query clause to $boost.

setBoost(float $boost) 

Parameters

$boost

float

Query specific matches highlighting

_highlightMatches(\Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) 

Parameters

$highlighter

\Zend_Search_Lucene_Search_Highlighter_Interface

Highlighter object (also contains doc for highlighting)

Constructs an initializes a Weight for a _top-level_query_.

_initWeight(\Zend_Search_Lucene_Interface $reader) 

Parameters

$reader

\Zend_Search_Lucene_Interface

 Properties

 

Query weight

$_weight : \Zend_Search_Lucene_Search_Weight

Default

null
 

query boost factor

$_boost : float

Default

1
 

Current highlight color

$_currentColorIndex : integer

Default

0