A field is a section of a Document. Each field has two parts, a name and a value. Values may be free text or they may be atomic keywords, which are not further processed. Such keywords may be used to represent dates, urls, etc. Fields are optionally stored in the index, so that they may be returned with hits on the 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

 Methods

Object constructor

__construct(string $name, string $value, string $encoding, boolean $isStored, boolean $isIndexed, boolean $isTokenized, boolean $isBinary = false

Parameters

$name

string

$value

string

$encoding

string

$isStored

boolean

$isIndexed

boolean

$isTokenized

boolean

$isBinary

boolean

Constructs a Binary String valued Field that is not tokenized nor indexed, but is stored in the index, for return with hits.

binary(string $name, string $value) : \Zend_Search_Lucene_Field
Static

Parameters

$name

string

$value

string

Returns

\Zend_Search_Lucene_Field

Get field value in UTF-8 encoding

getUtf8Value() : string

Returns

string

Constructs a String-valued Field that is not tokenized, but is indexed and stored. Useful for non-text fields, e.g. date or url.

keyword(string $name, string $value, string $encoding = '') : \Zend_Search_Lucene_Field
Static

Parameters

$name

string

$value

string

$encoding

string

Returns

\Zend_Search_Lucene_Field

Constructs a String-valued Field that is tokenized and indexed, and is stored in the index, for return with hits. Useful for short text fields, like "title" or "subject". Term vector will not be stored for this field.

text(string $name, string $value, string $encoding = '') : \Zend_Search_Lucene_Field
Static

Parameters

$name

string

$value

string

$encoding

string

Returns

\Zend_Search_Lucene_Field

Constructs a String-valued Field that is not tokenized nor indexed, but is stored in the index, for return with hits.

unIndexed(string $name, string $value, string $encoding = '') : \Zend_Search_Lucene_Field
Static

Parameters

$name

string

$value

string

$encoding

string

Returns

\Zend_Search_Lucene_Field

Constructs a String-valued Field that is tokenized and indexed, but that is not stored in the index.

unStored(string $name, string $value, string $encoding = '') : \Zend_Search_Lucene_Field
Static

Parameters

$name

string

$value

string

$encoding

string

Returns

\Zend_Search_Lucene_Field

 Properties

 

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

$boost : float

Default

1.0
 

Field value encoding.

$encoding : string

Default

 

Field is stored as binary.

$isBinary : boolean

Default

false
 

Field is to be indexed, so that it may be searched on.

$isIndexed : boolean

Default

true
 

Field is to be stored in the index for return with search hits.

$isStored : boolean

Default

false
 

Field should be tokenized as text prior to indexing.

$isTokenized : boolean

Default

true
 

Field name

$name : string

Default

 

Field are stored as a term vector

$storeTermVector : boolean

Default

false
 

Field value

$value : boolean

Default