IIndexDocument
in
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
Constants
- ENCODED_BASE64 = 1
- NOT_ENCODED = 0
Methods
- 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<string|int, mixed>
- 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<string|int, mixed>
- Get all info.
- getInfoArray() : array<string|int, mixed>
- 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<string|int, mixed>
- Get the list of meta tags assigned to the original document.
- getModifiedTime() : int
- Get the modified time of the original document.
- getMore() : array<string|int, mixed>
- Get more information.
- getParts() : array<string|int, mixed>
- 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<string|int, mixed>
- Get the list of sub tags assigned to the original document.
- getTags() : array<string|int, mixed>
- 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
Tags
NOT_ENCODED
public
mixed
NOT_ENCODED
= 0
Tags
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
IIndexDocumentaddMetaTag()
Add a meta tag to the list.
public
addMetaTag(string $tag) : IIndexDocument
Parameters
- $tag : string
Tags
Return values
IIndexDocumentaddPart()
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
IIndexDocumentaddSubTag()
Add a sub tag to the list.
public
addSubTag(string $sub, string $tag) : IIndexDocument
Parameters
- $sub : string
- $tag : string
Tags
Return values
IIndexDocumentaddTag()
Add a tag to the list.
public
addTag(string $tag) : IIndexDocument
Parameters
- $tag : string
Tags
Return values
IIndexDocumentgetAccess()
Get the IDocumentAccess related to the original document.
public
getAccess() : IDocumentAccess
Tags
Return values
IDocumentAccessgetContent()
Get the content of the original document.
public
getContent() : string
Tags
Return values
stringgetContentSize()
Return the size of the content.
public
getContentSize() : int
Tags
Return values
intgetExcerpts()
Get all excerpts of the content of the original document.
public
getExcerpts() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getHash()
Get the hash of the original document.
public
getHash() : string
Tags
Return values
stringgetId()
Returns the Id of the original document.
public
getId() : string
Tags
Return values
stringgetIndex()
Get the Index.
public
getIndex() : IIndex
Tags
Return values
IIndexgetInfo()
Get an information about a document. (string)
public
getInfo(string $info[, string $default = '' ]) : string
Parameters
- $info : string
- $default : string = ''
Tags
Return values
stringgetInfoAll()
Get all info.
public
getInfoAll() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getInfoArray()
Get an information about a document. (array)
public
getInfoArray(string $info[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $info : string
- $default : array<string|int, mixed> = []
Tags
Return values
array<string|int, mixed>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
boolgetInfoInt()
Get an information about a document. (int)
public
getInfoInt(string $info[, int $default = 0 ]) : int
Parameters
- $info : string
- $default : int = 0
Tags
Return values
intgetLink()
Get the link.
public
getLink() : string
Tags
Return values
stringgetMetaTags()
Get the list of meta tags assigned to the original document.
public
getMetaTags() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getModifiedTime()
Get the modified time of the original document.
public
getModifiedTime() : int
Tags
Return values
intgetMore()
Get more information.
public
getMore() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getParts()
Get all parts of the IIndexDocument.
public
getParts() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getProviderId()
Returns the Id of the provider.
public
getProviderId() : string
Tags
Return values
stringgetScore()
Get the score.
public
getScore() : string
Tags
Return values
stringgetSource()
Get the source of the original document.
public
getSource() : string
Tags
Return values
stringgetSubTags()
Get the list of sub tags assigned to the original document.
public
getSubTags([bool $formatted = false ]) : array<string|int, mixed>
If $formatted is true, the result will be formatted in a one dimensional array.
Parameters
- $formatted : bool = false
Tags
Return values
array<string|int, mixed>getTags()
Get the list of tags assigned to the original document.
public
getTags() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getTitle()
Get the title of the original document.
public
getTitle() : string
Tags
Return values
stringhasIndex()
return if Index is defined.
public
hasIndex() : bool
Tags
Return values
boolinitHash()
Generate an hash, based on the content of the original document.
public
initHash() : IIndexDocument
Tags
Return values
IIndexDocumentisContentEncoded()
Returns the type of the encoding on the content.
public
isContentEncoded() : int
Tags
Return values
intisOlderThan()
Check if the original document of the IIndexDocument is older than $time.
public
isOlderThan(int $time) : bool
Parameters
- $time : int
Tags
Return values
boolsetAccess()
Set the read rights of the original document using a IDocumentAccess.
public
setAccess(IDocumentAccess $access) : $this
Parameters
- $access : IDocumentAccess
Tags
Return values
$thissetContent()
Set the content of the document.
public
setContent(string $content[, int $encoded = 0 ]) : IIndexDocument
$encoded can be NOT_ENCODED or ENCODED_BASE64 if the content is raw or encoded in base64.
Parameters
- $content : string
- $encoded : int = 0
Tags
Return values
IIndexDocumentsetExcerpts()
Set all excerpts of the content of the original document.
public
setExcerpts(array<string|int, mixed> $excerpts) : IIndexDocument
Parameters
- $excerpts : array<string|int, mixed>
Tags
Return values
IIndexDocumentsetHash()
Set the hash of the original document.
public
setHash(string $hash) : IIndexDocument
Parameters
- $hash : string
Tags
Return values
IIndexDocumentsetIndex()
Set the Index related to the IIndexDocument.
public
setIndex(IIndex $index) : IIndexDocument
Parameters
- $index : IIndex
Tags
Return values
IIndexDocumentsetInfo()
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
IIndexDocumentsetInfoArray()
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<string|int, mixed> $value) : IIndexDocument
Parameters
- $info : string
- $value : array<string|int, mixed>
Tags
Return values
IIndexDocumentsetInfoBool()
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
IIndexDocumentsetInfoInt()
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
IIndexDocumentsetLink()
Add a link, usable by the frontend.
public
setLink(string $link) : IIndexDocument
Parameters
- $link : string
Tags
Return values
IIndexDocumentsetMetaTags()
Set the list of meta tags assigned to the original document.
public
setMetaTags(array<string|int, mixed> $tags) : IIndexDocument
Parameters
- $tags : array<string|int, mixed>
Tags
Return values
IIndexDocumentsetModifiedTime()
Set the modified time of the original document.
public
setModifiedTime(int $modifiedTime) : IIndexDocument
Parameters
- $modifiedTime : int
Tags
Return values
IIndexDocumentsetMore()
Set more information that couldn't be set using other method.
public
setMore(array<string|int, mixed> $more) : IIndexDocument
Parameters
- $more : array<string|int, mixed>
Tags
Return values
IIndexDocumentsetParts()
Set all parts and their content.
public
setParts(array<string|int, mixed> $parts) : IIndexDocument
Parameters
- $parts : array<string|int, mixed>
Tags
Return values
IIndexDocumentsetScore()
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
IIndexDocumentsetSource()
Set the source of the original document.
public
setSource(string $source) : IIndexDocument
Parameters
- $source : string
Tags
Return values
IIndexDocumentsetSubTags()
Set the list of sub tags assigned to the original document.
public
setSubTags(array<string|int, mixed> $tags) : IIndexDocument
Parameters
- $tags : array<string|int, mixed>
Tags
Return values
IIndexDocumentsetTags()
Set the list of tags assigned to the original document.
public
setTags(array<string|int, mixed> $tags) : IIndexDocument
Parameters
- $tags : array<string|int, mixed>
Tags
Return values
IIndexDocumentsetTitle()
Set the title of the original document.
public
setTitle(string $title) : IIndexDocument
Parameters
- $title : string