\Zend_Search_Lucene_Search_Query_Fuzzy
- Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Search_Lucene_Search_Query_Fuzzy
extends Zend_Search_Lucene_Search_Query
{
- // constants
- const DEFAULT_MIN_SIMILARITY = 0.5;
- const MAX_CLAUSE_COUNT = 1024;
- // members
- private array $_maxDistances = ;
- private Zend_Search_Lucene_Index_Term $_term;
- private $_minimumSimilarity;
- private $_prefixLength;
- private $_matches = NULL;
- private $_scores = NULL;
- private $_termKeys = NULL;
- private static integer $_defaultPrefixLength = 3;
- // Inherited members from Zend_Search_Lucene_Search_Query
- protected Zend_Search_Lucene_Search_Weight $_weight;
- // methods
- public void __construct()
- public static integer getDefaultPrefixLength()
- public static void setDefaultPrefixLength()
- private integer _calculateMaxDistance()
- public Zend_Search_Lucene_Search_Query rewrite()
- public Zend_Search_Lucene_Search_Query optimize()
- public array getQueryTerms()
- public Zend_Search_Lucene_Search_Weight createWeight()
- public void execute()
- public array matchedDocs()
- public float score()
- protected void _highlightMatches()
- public string __toString()
- // Inherited methods from Zend_Search_Lucene_Search_Query
- public float getBoost()
- public void setBoost()
- public abstract float score()
- public abstract array matchedDocs()
- public abstract void execute()
- public abstract Zend_Search_Lucene_Search_Weight createWeight()
- protected void _initWeight()
- public abstract Zend_Search_Lucene_Search_Query rewrite()
- public abstract Zend_Search_Lucene_Search_Query optimize()
- public void reset()
- public abstract string __toString()
- public abstract array getQueryTerms()
- protected abstract void _highlightMatches()
- public string highlightMatches()
- public string htmlFragmentHighlightMatches()
Hierarchy
Extends
Constants
Name | Value |
---|---|
DEFAULT_MIN_SIMILARITY | 0.5 |
MAX_CLAUSE_COUNT | 1024 |
Members
private
- $_defaultPrefixLength
—
integer
Default non-fuzzy prefix length - $_matches
—
array
Matched terms. -
$_maxDistances
Array of precalculated max distances - $_minimumSimilarity
—
float
A value between 0 and 1 to set the required similarity between the query term and the matching terms. For example, for a _minimumSimilarity of 0.5 a term of the same length as the query term is considered similar to the query term if the edit distance between both terms is less than length(term)*0.5 - $_prefixLength
—
integer
The length of common (non-fuzzy) prefix - $_scores
—
array
Matched terms scores - $_term
—
Zend_Search_Lucene_Index_Term
Base searching term. - $_termKeys
—
array
Array of the term keys.
protected
- $_weight
—
Zend_Search_Lucene_Search_Weight
Query weight
Methods
private
- _calculateMaxDistance() — Calculate maximum distance for specified word length
protected
- _highlightMatches() — Query specific matches highlighting
public
- __construct() — Zend_Search_Lucene_Search_Query_Wildcard constructor.
- __toString() — Print a query
- createWeight() — Constructs an appropriate Weight implementation for this query.
- execute() — Execute query in context of index reader It also initializes necessary internal structures
- getDefaultPrefixLength() — Get default non-fuzzy prefix length
- getQueryTerms() — Return query terms
- matchedDocs() — Get document ids likely matching the query
- optimize() — Optimize query in the context of specified index
- rewrite() — Re-write query into primitive queries in the context of specified index
- score() — Score specified document
- setDefaultPrefixLength() — Set default non-fuzzy prefix length
Inherited from Zend_Search_Lucene_Search_Query
protected
- _highlightMatches() — Query specific matches highlighting
- _initWeight() — Constructs an initializes a Weight for a _top-level_query_.
public
- __toString() — Print a query
- createWeight() — Constructs an appropriate Weight implementation for this query.
- execute() — Execute query in context of index reader It also initializes necessary internal structures
- 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.
- getQueryTerms() — Return query terms
- highlightMatches() — Highlight matches in $inputHTML
- htmlFragmentHighlightMatches() — Highlight matches in $inputHtmlFragment and return it (without HTML header and body tag)
- matchedDocs() — Get document ids likely matching the query
- optimize() — Optimize query in the context of specified index
- reset() — Reset query, so it can be reused within other queries or with other indeces
- rewrite() — Re-write query into primitive queries in the context of specified index
- score() — Score specified document
- setBoost() — Sets the boost for this query clause to $boost.