HTML document.

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

 Methods

Proxy method for getFieldValue(), provides more convenient access to the string value of a field.

__get(string $offset) : string
Inherited

Parameters

$offset

string

Returns

string

Add a field object to this document.

addField(\Zend_Search_Lucene_Field $field) : \Zend_Search_Lucene_Document
Inherited

Parameters

$field

\Zend_Search_Lucene_Field

Returns

\Zend_Search_Lucene_Document

Returns Zend_Search_Lucene_Field object for a named field in this document.

getField(string $fieldName) : \Zend_Search_Lucene_Field
Inherited

Parameters

$fieldName

string

Returns

\Zend_Search_Lucene_Field

Return an array with the names of the fields in this document.

getFieldNames() : array
Inherited

Returns

array

Returns the string value of a named field in UTF-8 encoding.

getFieldUtf8Value($fieldName) : string
Inherited
see

Parameters

$fieldName

Returns

string

Returns the string value of a named field in this document.

getFieldValue($fieldName) : string
Inherited
see

Parameters

$fieldName

Returns

string

Get HTML

getHTML() : string

Returns

string

Get HTML body

getHtmlBody() : string

Returns

string

Highlight text with specified color

highlight(string|array $words, string $colour = '#66ffff') : string

Parameters

$words

stringarray

$colour

string

Returns

string

Highlight text using specified View helper or callback function.

highlightExtended(string|array $words, callback $callback, array $params = array()) : string

Parameters

$words

stringarray

Words to highlight. Words could be organized using the array or string.

$callback

callback

Callback method, used to transform (highlighting) text.

$params

array

Array of additionall callback parameters passed through into it (first non-optional parameter is an HTML fragment for highlighting)

Exceptions

\Zend_Search_Lucene_Exception

Returns

string

Load HTML document from a string

loadHTML(string $data, boolean $storeContent = false, string $defaultEncoding = '') : \Zend_Search_Lucene_Document_Html
Static

Parameters

$data

string

$storeContent

boolean

$defaultEncoding

string

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

Returns

\Zend_Search_Lucene_Document_Html

Load HTML document from a file

loadHTMLFile(string $file, boolean $storeContent = false, string $defaultEncoding = '') : \Zend_Search_Lucene_Document_Html
Static

Parameters

$file

string

$storeContent

boolean

$defaultEncoding

string

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

Returns

\Zend_Search_Lucene_Document_Html

highlight words in content of the specified node

_highlightNodeRecursive(\DOMNode $contextNode, array $wordsToHighlight, callback $callback, array $params) 

Parameters

$contextNode

\DOMNode

$wordsToHighlight

array

$callback

callback

Callback method, used to transform (highlighting) text.

$params

array

Array of additionall callback parameters (first non-optional parameter is a text to transform)

Highlight text in text node

_highlightTextNode(\DOMText $node, array $wordsToHighlight, callback $callback, array $params) 

Parameters

$node

\DOMText

$wordsToHighlight

array

$callback

callback

Callback method, used to transform (highlighting) text.

$params

array

Array of additionall callback parameters (first non-optional parameter is a text to transform)

Exceptions

\Zend_Search_Lucene_Exception

Object constructor

__construct(string $data, boolean $isFile, boolean $storeContent, string $defaultEncoding = ''

Parameters

$data

string

HTML string (may be HTML fragment, )

$isFile

boolean

$storeContent

boolean

$defaultEncoding

string

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

Get node text

_retrieveNodeText(\DOMNode $node, $text) 

We should exclude scripts, which may be not included into comment tags, CDATA sections,

Parameters

$node

\DOMNode

$text

 Properties

 

Field boost factor It's not stored directly in the index, but affects on normalization factor

$boost : float

Default

1.0
 

Associative array Zend_Search_Lucene_Field objects where the keys to the array are the names of the fields.

$_fields : array

Default

array()
 

Stored DOM representation

$_doc : \DOMDocument

Default

     

List of inline tags

$_inlineTags : array

Default

array('a', 'abbr', 'acronym', 'dfn', 'em', 'strong', 'code', 'samp', 'kbd', 'var', 'b', 'i', 'big', 'small', 'strike', 'tt', 'u', 'font', 'span', 'bdo', 'cite', 'del', 'ins', 'q', 'sub', 'sup')