IIndexDocument
Class IIndexDocument
This is one of the main class of the FullTextSearch, used as a data transfer object. An IIndexDocument is created to manage documents around FullTextSearch, during an index and during a search. The uniqueness of an IIndexDocument is made by the Id of the Content Provider and the Id of the original document within the Content Provider.
We will call original document the source from which the IIndexDocument is generated. As an example, an original document can be a file, a mail, ...
Tags
Table of Contents
- ENCODED_BASE64 = 1
- NOT_ENCODED = 0
- addExcerpt() : IIndexDocument
- Add some excerpt of the content of the original document, usually based on the search request.
- addMetaTag() : IIndexDocument
- Add a meta tag to the list.
- addPart() : IIndexDocument
- Add a part, identified by a string, and its content.
- addSubTag() : IIndexDocument
- Add a sub tag to the list.
- addTag() : IIndexDocument
- Add a tag to the list.
- getAccess() : IDocumentAccess
- Get the IDocumentAccess related to the original document.
- getContent() : string
- Get the content of the original document.
- getContentSize() : int
- Return the size of the content.
- getExcerpts() : array
- Get all excerpts of the content of the original document.
- getHash() : string
- Get the hash of the original document.
- getId() : string
- Returns the Id of the original document.
- getIndex() : IIndex
- Get the Index.
- getInfo() : string
- Get an information about a document. (string)
- getInfoAll() : array
- Get all info.
- getInfoArray() : array
- Get an information about a document. (array)
- getInfoBool() : bool
- Get an information about a document. (bool)
- getInfoInt() : int
- Get an information about a document. (int)
- getLink() : string
- Get the link.
- getMetaTags() : array
- Get the list of meta tags assigned to the original document.
- getModifiedTime() : int
- Get the modified time of the original document.
- getMore() : array
- Get more information.
- getParts() : array
- Get all parts of the IIndexDocument.
- getProviderId() : string
- Returns the Id of the provider.
- getScore() : string
- Get the score.
- getSource() : string
- Get the source of the original document.
- getSubTags() : array
- Get the list of sub tags assigned to the original document.
- getTags() : array
- Get the list of tags assigned to the original document.
- getTitle() : string
- Get the title of the original document.
- hasIndex() : bool
- return if Index is defined.
- initHash() : IIndexDocument
- Generate an hash, based on the content of the original document.
- isContentEncoded() : int
- Returns the type of the encoding on the content.
- isOlderThan() : bool
- Check if the original document of the IIndexDocument is older than $time.
- setAccess() : $this
- Set the read rights of the original document using a IDocumentAccess.
- setContent() : IIndexDocument
- Set the content of the document.
- setExcerpts() : IIndexDocument
- Set all excerpts of the content of the original document.
- setHash() : IIndexDocument
- Set the hash of the original document.
- setIndex() : IIndexDocument
- Set the Index related to the IIndexDocument.
- setInfo() : IIndexDocument
- Set some information about the original document that will be available to the front-end when displaying search result. (as string) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
- setInfoArray() : IIndexDocument
- Set some information about the original document that will be available to the front-end when displaying search result. (as array) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
- setInfoBool() : IIndexDocument
- Set some information about the original document that will be available to the front-end when displaying search result. (as bool) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
- setInfoInt() : IIndexDocument
- Set some information about the original document that will be available to the front-end when displaying search result. (as int) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
- setLink() : IIndexDocument
- Add a link, usable by the frontend.
- setMetaTags() : IIndexDocument
- Set the list of meta tags assigned to the original document.
- setModifiedTime() : IIndexDocument
- Set the modified time of the original document.
- setMore() : IIndexDocument
- Set more information that couldn't be set using other method.
- setParts() : IIndexDocument
- Set all parts and their content.
- setScore() : IIndexDocument
- Set the score to the result assigned to this document during a search request.
- setSource() : IIndexDocument
- Set the source of the original document.
- setSubTags() : IIndexDocument
- Set the list of sub tags assigned to the original document.
- setTags() : IIndexDocument
- Set the list of tags assigned to the original document.
- setTitle() : IIndexDocument
- Set the title of the original document.
Constants
ENCODED_BASE64
public
mixed
ENCODED_BASE64
= 1
NOT_ENCODED
public
mixed
NOT_ENCODED
= ""
Methods
addExcerpt()
Add some excerpt of the content of the original document, usually based on the search request.
public
addExcerpt(string $source, string $excerpt) : IIndexDocument
Parameters
- $source : string
- $excerpt : string
Tags
Return values
IIndexDocument —addMetaTag()
Add a meta tag to the list.
public
addMetaTag(string $tag) : IIndexDocument
Parameters
- $tag : string
Tags
Return values
IIndexDocument —addPart()
Add a part, identified by a string, and its content.
public
addPart(string $part, string $content) : IIndexDocument
It is strongly advised to use alphanumerical chars with no space in the $part string.
Parameters
- $part : string
- $content : string
Tags
Return values
IIndexDocument —addSubTag()
Add a sub tag to the list.
public
addSubTag(string $sub, string $tag) : IIndexDocument
Parameters
- $sub : string
- $tag : string
Tags
Return values
IIndexDocument —addTag()
Add a tag to the list.
public
addTag(string $tag) : IIndexDocument
Parameters
- $tag : string
Tags
Return values
IIndexDocument —getAccess()
Get the IDocumentAccess related to the original document.
public
getAccess() : IDocumentAccess
Tags
Return values
IDocumentAccess —getContent()
Get the content of the original document.
public
getContent() : string
Tags
Return values
string —getContentSize()
Return the size of the content.
public
getContentSize() : int
Tags
Return values
int —getExcerpts()
Get all excerpts of the content of the original document.
public
getExcerpts() : array
Tags
Return values
array —getHash()
Get the hash of the original document.
public
getHash() : string
Tags
Return values
string —getId()
Returns the Id of the original document.
public
getId() : string
Tags
Return values
string —getIndex()
Get the Index.
public
getIndex() : IIndex
Tags
Return values
IIndex —getInfo()
Get an information about a document. (string)
public
getInfo(string $info[, string $default = '' ]) : string
Parameters
- $info : string
- $default : string = ''
Tags
Return values
string —getInfoAll()
Get all info.
public
getInfoAll() : array
Tags
Return values
array —getInfoArray()
Get an information about a document. (array)
public
getInfoArray(string $info[, array $default = [] ]) : array
Parameters
- $info : string
- $default : array = []
Tags
Return values
array —getInfoBool()
Get an information about a document. (bool)
public
getInfoBool(string $info[, bool $default = false ]) : bool
Parameters
- $info : string
- $default : bool = false
Tags
Return values
bool —getInfoInt()
Get an information about a document. (int)
public
getInfoInt(string $info, int $default) : int
Parameters
- $info : string
- $default : int
Tags
Return values
int —getLink()
Get the link.
public
getLink() : string
Tags
Return values
string —getMetaTags()
Get the list of meta tags assigned to the original document.
public
getMetaTags() : array
Tags
Return values
array —getModifiedTime()
Get the modified time of the original document.
public
getModifiedTime() : int
Tags
Return values
int —getMore()
Get more information.
public
getMore() : array
Tags
Return values
array —getParts()
Get all parts of the IIndexDocument.
public
getParts() : array
Tags
Return values
array —getProviderId()
Returns the Id of the provider.
public
getProviderId() : string
Tags
Return values
string —getScore()
Get the score.
public
getScore() : string
Tags
Return values
string —getSource()
Get the source of the original document.
public
getSource() : string
Tags
Return values
string —getSubTags()
Get the list of sub tags assigned to the original document.
public
getSubTags([bool $formatted = false ]) : array
If $formatted is true, the result will be formatted in a one dimensional array.
Parameters
- $formatted : bool = false
Tags
Return values
array —getTags()
Get the list of tags assigned to the original document.
public
getTags() : array
Tags
Return values
array —getTitle()
Get the title of the original document.
public
getTitle() : string
Tags
Return values
string —hasIndex()
return if Index is defined.
public
hasIndex() : bool
Tags
Return values
bool —initHash()
Generate an hash, based on the content of the original document.
public
initHash() : IIndexDocument
Tags
Return values
IIndexDocument —isContentEncoded()
Returns the type of the encoding on the content.
public
isContentEncoded() : int
Tags
Return values
int —isOlderThan()
Check if the original document of the IIndexDocument is older than $time.
public
isOlderThan(int $time) : bool
Parameters
- $time : int
Tags
Return values
bool —setAccess()
Set the read rights of the original document using a IDocumentAccess.
public
setAccess(IDocumentAccess $access) : $this
Parameters
- $access : IDocumentAccess
Tags
Return values
$this —setContent()
Set the content of the document.
public
setContent(string $content, int $encoded) : IIndexDocument
$encoded can be NOT_ENCODED or ENCODED_BASE64 if the content is raw or encoded in base64.
Parameters
- $content : string
- $encoded : int
Tags
Return values
IIndexDocument —setExcerpts()
Set all excerpts of the content of the original document.
public
setExcerpts(array $excerpts) : IIndexDocument
Parameters
- $excerpts : array
Tags
Return values
IIndexDocument —setHash()
Set the hash of the original document.
public
setHash(string $hash) : IIndexDocument
Parameters
- $hash : string
Tags
Return values
IIndexDocument —setIndex()
Set the Index related to the IIndexDocument.
public
setIndex(IIndex $index) : IIndexDocument
Parameters
- $index : IIndex
Tags
Return values
IIndexDocument —setInfo()
Set some information about the original document that will be available to the front-end when displaying search result. (as string) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
public
setInfo(string $info, string $value) : IIndexDocument
Parameters
- $info : string
- $value : string
Tags
Return values
IIndexDocument —setInfoArray()
Set some information about the original document that will be available to the front-end when displaying search result. (as array) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
public
setInfoArray(string $info, array $value) : IIndexDocument
Parameters
- $info : string
- $value : array
Tags
Return values
IIndexDocument —setInfoBool()
Set some information about the original document that will be available to the front-end when displaying search result. (as bool) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
public
setInfoBool(string $info, bool $value) : IIndexDocument
Parameters
- $info : string
- $value : bool
Tags
Return values
IIndexDocument —setInfoInt()
Set some information about the original document that will be available to the front-end when displaying search result. (as int) Because this information will not be indexed, this method can also be used to manage some data while filling the IIndexDocument before its indexing.
public
setInfoInt(string $info, int $value) : IIndexDocument
Parameters
- $info : string
- $value : int
Tags
Return values
IIndexDocument —setLink()
Add a link, usable by the frontend.
public
setLink(string $link) : IIndexDocument
Parameters
- $link : string
Tags
Return values
IIndexDocument —setMetaTags()
Set the list of meta tags assigned to the original document.
public
setMetaTags(array $tags) : IIndexDocument
Parameters
- $tags : array
Tags
Return values
IIndexDocument —setModifiedTime()
Set the modified time of the original document.
public
setModifiedTime(int $modifiedTime) : IIndexDocument
Parameters
- $modifiedTime : int
Tags
Return values
IIndexDocument —setMore()
Set more information that couldn't be set using other method.
public
setMore(array $more) : IIndexDocument
Parameters
- $more : array
Tags
Return values
IIndexDocument —setParts()
Set all parts and their content.
public
setParts(array $parts) : IIndexDocument
Parameters
- $parts : array
Tags
Return values
IIndexDocument —setScore()
Set the score to the result assigned to this document during a search request.
public
setScore(string $score) : IIndexDocument
Parameters
- $score : string
Tags
Return values
IIndexDocument —setSource()
Set the source of the original document.
public
setSource(string $source) : IIndexDocument
Parameters
- $source : string
Tags
Return values
IIndexDocument —setSubTags()
Set the list of sub tags assigned to the original document.
public
setSubTags(array $tags) : IIndexDocument
Parameters
- $tags : array
Tags
Return values
IIndexDocument —setTags()
Set the list of tags assigned to the original document.
public
setTags(array $tags) : IIndexDocument
Parameters
- $tags : array
Tags
Return values
IIndexDocument —setTitle()
Set the title of the original document.
public
setTitle(string $title) : IIndexDocument
Parameters
- $title : string