Wildcard
extends AbstractQuery
in package
Tags
Table of Contents
Properties
- $_weight : AbstractWeight
- AbstractQuery weight
- $_boost : float
- query boost factor
- $_matches : array<string|int, mixed>
- Matched terms.
- $_minPrefixLength : int
- Minimum term prefix length (number of minimum non-wildcard characters)
- $_pattern : Term
- Search pattern.
Methods
- __construct() : mixed
- Zend_Search_Lucene_Search_Query_Wildcard constructor.
- __toString() : string
- Print a query
- createWeight() : AbstractWeight
- Constructs an appropriate Weight implementation for this query.
- execute() : void
- Execute query in context of index reader It also initializes necessary internal structures
- getBoost() : float
- 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.
- getMinPrefixLength() : int
- Get minimum prefix length
- getPattern() : Term
- Returns query pattern
- getQueryTerms() : array<string|int, mixed>
- Return query terms
- highlightMatches() : string
- Highlight matches in $inputHTML
- htmlFragmentHighlightMatches() : string
- Highlight matches in $inputHTMLFragment and return it (without HTML header and body tag)
- matchedDocs() : array<string|int, mixed>
- Get document ids likely matching the query
- optimize() : AbstractQuery
- Optimize query in the context of specified index
- reset() : void
- Reset query, so it can be reused within other queries or with other indeces
- rewrite() : AbstractQuery
- Re-write query into primitive queries in the context of specified index
- score() : float
- Score specified document
- setBoost() : void
- Sets the boost for this query clause to $boost.
- setMinPrefixLength() : void
- Set minimum prefix length
- _highlightMatches() : void
- Query specific matches highlighting
- _initWeight() : AbstractWeight|null
- Constructs an initializes a Weight for a _top-level_query_.
- _getPrefix() : string
- Get terms prefix
Properties
$_weight
AbstractQuery weight
protected
AbstractWeight
$_weight
= null
$_boost
query boost factor
private
float
$_boost
= 1
$_matches
Matched terms.
private
array<string|int, mixed>
$_matches
= null
Matched terms list. It's filled during the search (rewrite operation) and may be used for search result post-processing
Array of Zend_Search_Lucene_Index_Term objects
$_minPrefixLength
Minimum term prefix length (number of minimum non-wildcard characters)
private
static int
$_minPrefixLength
= 3
$_pattern
Search pattern.
private
Term
$_pattern
Field has to be fully specified or has to be null Text may contain '*' or '?' symbols
Methods
__construct()
Zend_Search_Lucene_Search_Query_Wildcard constructor.
public
__construct(Term $pattern) : mixed
Parameters
- $pattern : Term
__toString()
Print a query
public
__toString() : string
Return values
stringcreateWeight()
Constructs an appropriate Weight implementation for this query.
public
createWeight(SearchIndexInterface $reader) : AbstractWeight
Parameters
- $reader : SearchIndexInterface
Tags
Return values
AbstractWeightexecute()
Execute query in context of index reader It also initializes necessary internal structures
public
execute(SearchIndexInterface $reader[, DocsFilter|null $docsFilter = null ]) : void
Parameters
- $reader : SearchIndexInterface
- $docsFilter : DocsFilter|null = null
Tags
getBoost()
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.
public
getBoost() : float
Return values
floatgetMinPrefixLength()
Get minimum prefix length
public
static getMinPrefixLength() : int
Return values
intgetPattern()
Returns query pattern
public
getPattern() : Term
Return values
TermgetQueryTerms()
Return query terms
public
getQueryTerms() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>highlightMatches()
Highlight matches in $inputHTML
public
highlightMatches(string $inputHTML[, string $defaultEncoding = '' ][, HighlighterInterface|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 : HighlighterInterface|null = null
Return values
stringhtmlFragmentHighlightMatches()
Highlight matches in $inputHTMLFragment and return it (without HTML header and body tag)
public
htmlFragmentHighlightMatches(string $inputHTMLFragment[, string $encoding = 'UTF-8' ][, HighlighterInterface|null $highlighter = null ]) : string
Parameters
- $inputHTMLFragment : string
- $encoding : string = 'UTF-8'
-
Input HTML string encoding
- $highlighter : HighlighterInterface|null = null
Return values
stringmatchedDocs()
Get document ids likely matching the query
public
matchedDocs() : array<string|int, mixed>
It's an array with document ids as keys (performance considerations)
Tags
Return values
array<string|int, mixed>optimize()
Optimize query in the context of specified index
public
optimize(SearchIndexInterface $index) : AbstractQuery
Parameters
- $index : SearchIndexInterface
Tags
Return values
AbstractQueryreset()
Reset query, so it can be reused within other queries or with other indeces
public
reset() : void
rewrite()
Re-write query into primitive queries in the context of specified index
public
rewrite(SearchIndexInterface $index) : AbstractQuery
Parameters
- $index : SearchIndexInterface
Tags
Return values
AbstractQueryscore()
Score specified document
public
score(int $docId, SearchIndexInterface $reader) : float
Parameters
- $docId : int
- $reader : SearchIndexInterface
Tags
Return values
floatsetBoost()
Sets the boost for this query clause to $boost.
public
setBoost(float $boost) : void
Parameters
- $boost : float
setMinPrefixLength()
Set minimum prefix length
public
static setMinPrefixLength(int $minPrefixLength) : void
Parameters
- $minPrefixLength : int
_highlightMatches()
Query specific matches highlighting
protected
_highlightMatches(HighlighterInterface $highlighter) : void
Parameters
- $highlighter : HighlighterInterface
-
Highlighter object (also contains doc for highlighting)
_initWeight()
Constructs an initializes a Weight for a _top-level_query_.
protected
_initWeight(SearchIndexInterface $reader) : AbstractWeight|null
Parameters
- $reader : SearchIndexInterface
Return values
AbstractWeight|null_getPrefix()
Get terms prefix
private
static _getPrefix(string $word) : string
Parameters
- $word : string