Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Zend_Search_Lucene_Document_Html Class Reference

Public Member Functions

 getLinks ()
 Get document HREF links.
 
 getHeaderLinks ()
 Get document header links.
 
 applyColour ($stringToHighlight, $colour)
 Standard callback method used to highlight words.
 
 highlight ($words, $colour= '#66ffff')
 Highlight text with specified color.
 
 highlightExtended ($words, $callback, $params=array())
 Highlight text using specified View helper or callback function.
 
 getHTML ()
 Get HTML.
 
 getHtmlBody ()
 Get HTML body.
 
- Public Member Functions inherited from Zend_Search_Lucene_Document
 __get ($offset)
 Proxy method for getFieldValue(), provides more convenient access to the string value of a field.
 
 addField (Zend_Search_Lucene_Field $field)
 Add a field object to this document.
 
 getFieldNames ()
 Return an array with the names of the fields in this document.
 
 getField ($fieldName)
 Returns Zend_Search_Lucene_Field object for a named field in this document.
 
 getFieldValue ($fieldName)
 Returns the string value of a named field in this document.
 
 getFieldUtf8Value ($fieldName)
 Returns the string value of a named field in UTF-8 encoding.
 

Static Public Member Functions

static setExcludeNoFollowLinks ($newValue)
 Set exclude nofollow links flag.
 
static getExcludeNoFollowLinks ()
 Get exclude nofollow links flag.
 
static loadHTML ($data, $storeContent=false, $defaultEncoding= '')
 Load HTML document from a string.
 
static loadHTMLFile ($file, $storeContent=false, $defaultEncoding= '')
 Load HTML document from a file.
 

Protected Member Functions

 _highlightTextNode (DOMText $node, $wordsToHighlight, $callback, $params)
 Highlight text in text node.
 
 _highlightNodeRecursive (DOMNode $contextNode, $wordsToHighlight, $callback, $params)
 highlight words in content of the specified node
 

Additional Inherited Members

- Public Attributes inherited from Zend_Search_Lucene_Document
 $boost = 1.0
 
- Protected Attributes inherited from Zend_Search_Lucene_Document
 $_fields = array()
 

Member Function Documentation

_highlightNodeRecursive ( DOMNode  $contextNode,
  $wordsToHighlight,
  $callback,
  $params 
)
protected

highlight words in content of the specified node

Parameters
DOMNode$contextNode
array$wordsToHighlight
callback$callbackCallback method, used to transform (highlighting) text.
array$paramsArray of additionall callback parameters (first non-optional parameter is a text to transform)
_highlightTextNode ( DOMText  $node,
  $wordsToHighlight,
  $callback,
  $params 
)
protected

Highlight text in text node.

Parameters
DOMText$node
array$wordsToHighlight
callback$callbackCallback method, used to transform (highlighting) text.
array$paramsArray of additionall callback parameters (first non-optional parameter is a text to transform)
Exceptions
Zend_Search_Lucene_Exception

Zend_Search_Lucene_Analysis_Analyzer

applyColour (   $stringToHighlight,
  $colour 
)

Standard callback method used to highlight words.

Parameters
string$stringToHighlight
Returns
string
static getExcludeNoFollowLinks ( )
static

Get exclude nofollow links flag.

Returns
boolean
getHeaderLinks ( )

Get document header links.

Returns
array
getHTML ( )

Get HTML.

Returns
string
getHtmlBody ( )

Get HTML body.

Returns
string
getLinks ( )

Get document HREF links.

Returns
array
highlight (   $words,
  $colour = '#66ffff' 
)

Highlight text with specified color.

Parameters
string | array$words
string$colour
Returns
string
highlightExtended (   $words,
  $callback,
  $params = array() 
)

Highlight text using specified View helper or callback function.

Parameters
string | array$wordsWords to highlight. Words could be organized using the array or string.
callback$callbackCallback method, used to transform (highlighting) text.
array$paramsArray of additionall callback parameters passed through into it (first non-optional parameter is an HTML fragment for highlighting)
Returns
string
Exceptions
Zend_Search_Lucene_Exception

Zend_Search_Lucene_Analysis_Analyzer

static loadHTML (   $data,
  $storeContent = false,
  $defaultEncoding = '' 
)
static

Load HTML document from a string.

Parameters
string$data
boolean$storeContent
string$defaultEncodingHTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.
Returns
Zend_Search_Lucene_Document_Html
static loadHTMLFile (   $file,
  $storeContent = false,
  $defaultEncoding = '' 
)
static

Load HTML document from a file.

Parameters
string$file
boolean$storeContent
string$defaultEncodingHTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag.
Returns
Zend_Search_Lucene_Document_Html
static setExcludeNoFollowLinks (   $newValue)
static

Set exclude nofollow links flag.

Parameters
boolean$newValue