Search/Lucene/Document/Html.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Search_Lucene
- Subpackage
- Document
- Version
- $Id: Html.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Search_Lucene_Document_Html
HTML document.
Each field has a name and a textual value.
- Parent(s)
- \Zend_Search_Lucene_Document
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties


boolean $_excludeNoFollowLinks = false
Exclud nofollow links flag
If true then links with rel='nofollow' attribute are not included into document links.
false
Details- Type
- boolean


array $_fields = array()
Associative array Zend_Search_Lucene_Field objects where the keys to the array are the names of the fields.
Inherited from: \Zend_Search_Lucene_Document::$$_fieldsarray()
Details- Type
- array
- Inherited_from
- \Zend_Search_Lucene_Document::$$_fields


array $_inlineTags = 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')
List of inline tags
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')
Details- Type
- array


float $boost = 1.0
Field boost factor It's not stored directly in the index, but affects on normalization factor
Inherited from: \Zend_Search_Lucene_Document::$$boost1.0
Details- Type
- float
- Inherited_from
- \Zend_Search_Lucene_Document::$$boost
Methods


__construct(string $data, boolean $isFile, boolean $storeContent, string $defaultEncoding = '') : void
Object constructor
Name | Type | Description |
---|---|---|
$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(string $offset) : string
Proxy method for getFieldValue(), provides more convenient access to the string value of a field.
Inherited from: \Zend_Search_Lucene_Document::__get()Name | Type | Description |
---|---|---|
$offset | string |
Type | Description |
---|---|
string |


_highlightNodeRecursive(\DOMNode $contextNode, array $wordsToHighlight, callback $callback, array $params) : void
highlight words in content of the specified node
Name | Type | Description |
---|---|---|
$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) |


_highlightTextNode(\DOMText $node, array $wordsToHighlight, callback $callback, array $params) : void
Highlight text in text node
Name | Type | Description |
---|---|---|
$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) |
Exception | Description |
---|---|
\Zend_Search_Lucene_Exception |


_retrieveNodeText(\DOMNode $node, string $text) : void
Get node text
We should exclude scripts, which may be not included into comment tags, CDATA sections,
Name | Type | Description |
---|---|---|
$node | \DOMNode | |
$text | string | &$text |


addField(\Zend_Search_Lucene_Field $field) : \Zend_Search_Lucene_Document
Add a field object to this document.
Inherited from: \Zend_Search_Lucene_Document::addField()Name | Type | Description |
---|---|---|
$field | \Zend_Search_Lucene_Field |
Type | Description |
---|---|
\Zend_Search_Lucene_Document |


getExcludeNoFollowLinks() : boolean
Get exclude nofollow links flag
Type | Description |
---|---|
boolean |


getField(string $fieldName) : \Zend_Search_Lucene_Field
Returns Zend_Search_Lucene_Field object for a named field in this document.
Inherited from: \Zend_Search_Lucene_Document::getField()Name | Type | Description |
---|---|---|
$fieldName | string |
Type | Description |
---|---|
\Zend_Search_Lucene_Field |


getFieldNames() : array
Return an array with the names of the fields in this document.
Inherited from: \Zend_Search_Lucene_Document::getFieldNames()Type | Description |
---|---|
array |


getFieldUtf8Value( $fieldName) : string
Returns the string value of a named field in UTF-8 encoding.
Inherited from: \Zend_Search_Lucene_Document::getFieldUtf8Value()Name | Type | Description |
---|---|---|
$fieldName |
Type | Description |
---|---|
string |
- See
- \global\__get()


getFieldValue( $fieldName) : string
Returns the string value of a named field in this document.
Inherited from: \Zend_Search_Lucene_Document::getFieldValue()Name | Type | Description |
---|---|---|
$fieldName |
Type | Description |
---|---|
string |
- See
- \global\__get()


highlight(string | array $words, string $colour = '#66ffff') : string
Highlight text with specified color
Name | Type | Description |
---|---|---|
$words | string | array | |
$colour | string |
Type | Description |
---|---|
string |


highlightExtended(string | array $words, callback $callback, array $params = array()) : string
Highlight text using specified View helper or callback function.
Name | Type | Description |
---|---|---|
$words | string | array | 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) |
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Search_Lucene_Exception |


loadHTML(string $data, boolean $storeContent = false, string $defaultEncoding = '') : \Zend_Search_Lucene_Document_Html
Load HTML document from a string
Name | Type | Description |
---|---|---|
$data | string | |
$storeContent | boolean | |
$defaultEncoding | string | HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag. |
Type | Description |
---|---|
\Zend_Search_Lucene_Document_Html |


loadHTMLFile(string $file, boolean $storeContent = false, string $defaultEncoding = '') : \Zend_Search_Lucene_Document_Html
Load HTML document from a file
Name | Type | Description |
---|---|---|
$file | string | |
$storeContent | boolean | |
$defaultEncoding | string | HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag. |
Type | Description |
---|---|
\Zend_Search_Lucene_Document_Html |