Search/Lucene/Document/Html.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 license@zend.com 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

Package: Zend\Search\Lucene\Document
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

>VPropertyprivate\DOMDocument $_doc
Stored DOM representation
Details
Type
\DOMDocument
>VPropertyprivateboolean $_excludeNoFollowLinks = false
static
Exclud nofollow links flag

If true then links with rel='nofollow' attribute are not included into document links.

Default valuefalseDetails
Type
boolean
>VPropertyprotectedarray $_fields = array()
inherited
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::$$_fields
Default valuearray()Details
Type
array
Inherited_from
\Zend_Search_Lucene_Document::$$_fields  
>VPropertyprivatearray $_headerLinks = array()
List of document header links
Default valuearray()Details
Type
array
>VPropertyprivatearray $_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
Default valuearray('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
>VPropertyprivatearray $_links = array()
List of document links
Default valuearray()Details
Type
array
>VPropertypublicfloat $boost = 1.0
inherited
Field boost factor It's not stored directly in the index, but affects on normalization factor
Inherited from: \Zend_Search_Lucene_Document::$$boost
Default value1.0Details
Type
float
Inherited_from
\Zend_Search_Lucene_Document::$$boost  

Methods

methodprivate__construct(string $data, boolean $isFile, boolean $storeContent, string $defaultEncoding = '') : void

Object constructor

Parameters
NameTypeDescription
$datastring

HTML string (may be HTML fragment, )

$isFileboolean
$storeContentboolean
$defaultEncodingstring

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

methodpublic__get(string $offset) : string
inherited

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

Inherited from: \Zend_Search_Lucene_Document::__get()
Parameters
NameTypeDescription
$offsetstring
Returns
TypeDescription
string
methodprotected_highlightNodeRecursive(\DOMNode $contextNode, array $wordsToHighlight, callback $callback, array $params) : void

highlight words in content of the specified node

Parameters
NameTypeDescription
$contextNode\DOMNode
$wordsToHighlightarray
$callbackcallback

Callback method, used to transform (highlighting) text.

$paramsarray

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

methodprotected_highlightTextNode(\DOMText $node, array $wordsToHighlight, callback $callback, array $params) : void

Highlight text in text node

Parameters
NameTypeDescription
$node\DOMText
$wordsToHighlightarray
$callbackcallback

Callback method, used to transform (highlighting) text.

$paramsarray

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

Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodprivate_retrieveNodeText(\DOMNode $node, string $text) : void

Get node text

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

Parameters
NameTypeDescription
$node\DOMNode
$textstring

&$text

methodpublicaddField(\Zend_Search_Lucene_Field $field) : \Zend_Search_Lucene_Document
inherited

Add a field object to this document.

Inherited from: \Zend_Search_Lucene_Document::addField()
Parameters
NameTypeDescription
$field\Zend_Search_Lucene_Field
Returns
TypeDescription
\Zend_Search_Lucene_Document
methodpublicgetExcludeNoFollowLinks() : boolean
static

Get exclude nofollow links flag

Returns
TypeDescription
boolean
methodpublicgetField(string $fieldName) : \Zend_Search_Lucene_Field
inherited

Returns Zend_Search_Lucene_Field object for a named field in this document.

Inherited from: \Zend_Search_Lucene_Document::getField()
Parameters
NameTypeDescription
$fieldNamestring
Returns
TypeDescription
\Zend_Search_Lucene_Field
methodpublicgetFieldNames() : array
inherited

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

Inherited from: \Zend_Search_Lucene_Document::getFieldNames()
Returns
TypeDescription
array
methodpublicgetFieldUtf8Value( $fieldName) : string
inherited

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

Inherited from: \Zend_Search_Lucene_Document::getFieldUtf8Value()
Parameters
NameTypeDescription
$fieldName
Returns
TypeDescription
string
Details
See
\__get()  
methodpublicgetFieldValue( $fieldName) : string
inherited

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

Inherited from: \Zend_Search_Lucene_Document::getFieldValue()
Parameters
NameTypeDescription
$fieldName
Returns
TypeDescription
string
Details
See
\__get()  
methodpublicgetHTML() : string

Get HTML

Returns
TypeDescription
string
methodpublicgetHeaderLinks() : array

Get document header links

Returns
TypeDescription
array
methodpublicgetHtmlBody() : string

Get HTML body

Returns
TypeDescription
string
methodpublicgetLinks() : array

Get document HREF links

Returns
TypeDescription
array
methodpublichighlight(string | array $words, string $colour = '#66ffff') : string

Highlight text with specified color

Parameters
NameTypeDescription
$wordsstring | array
$colourstring
Returns
TypeDescription
string
methodpublichighlightExtended(string | array $words, callback $callback, array $params = array()) : string

Highlight text using specified View helper or callback function.

Parameters
NameTypeDescription
$wordsstring | array

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

$callbackcallback

Callback method, used to transform (highlighting) text.

$paramsarray

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

Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Search_Lucene_Exception
methodpublicloadHTML(string $data, boolean $storeContent = false, string $defaultEncoding = '') : \Zend_Search_Lucene_Document_Html
static

Load HTML document from a string

Parameters
NameTypeDescription
$datastring
$storeContentboolean
$defaultEncodingstring

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

Returns
TypeDescription
\Zend_Search_Lucene_Document_Html
methodpublicloadHTMLFile(string $file, boolean $storeContent = false, string $defaultEncoding = '') : \Zend_Search_Lucene_Document_Html
static

Load HTML document from a file

Parameters
NameTypeDescription
$filestring
$storeContentboolean
$defaultEncodingstring

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

Returns
TypeDescription
\Zend_Search_Lucene_Document_Html
methodpublicsetExcludeNoFollowLinks(boolean $newValue) : void
static

Set exclude nofollow links flag

Parameters
NameTypeDescription
$newValueboolean
Documentation was generated by phpDocumentor 2.0.0a12.