IIndexDocument

interface OCP\FullTextSearch\Model\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, ...
Implemented by:OC\FullTextSearch\Model\IndexDocument
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#44

Methods

public OCP\FullTextSearch\Model\IIndexDocument::getId()
Returns the Id of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#57
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::getProviderId()
Returns the Id of the provider.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#67
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::setIndex($index)
Set the Index related to the IIndexDocument.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#81

Parameters:
See:

\OCP\FullTextSearch\Model\IIndex

Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getIndex()
Get the Index.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#90
Since:15.0.0
Returns:\OCP\FullTextSearch\Model\IIndex
public OCP\FullTextSearch\Model\IIndexDocument::hasIndex()
return if Index is defined.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#99
Since:16.0.0
Returns:bool
public OCP\FullTextSearch\Model\IIndexDocument::setModifiedTime($modifiedTime)
Set the modified time of the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#111

Parameters:
  • $modifiedTime (int)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getModifiedTime()
Get the modified time of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#120
Since:15.0.0
Returns:int
public OCP\FullTextSearch\Model\IIndexDocument::isOlderThan($time)
Check if the original document of the IIndexDocument is older than $time.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#131

Parameters:
  • $time (int)
Since:

15.0.0

Returns:

bool

public OCP\FullTextSearch\Model\IIndexDocument::setAccess($access)
Set the read rights of the original document using a IDocumentAccess.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#145

Parameters:
See:

\OCP\FullTextSearch\Model\IDocumentAccess

Since:

15.0.0

Returns:

$this

public OCP\FullTextSearch\Model\IIndexDocument::getAccess()
Get the IDocumentAccess related to the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#154
Since:15.0.0
Returns:\OCP\FullTextSearch\Model\IDocumentAccess
public OCP\FullTextSearch\Model\IIndexDocument::addTag($tag)
Add a tag to the list.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#166

Parameters:
  • $tag (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::setTags($tags)
Set the list of tags assigned to the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#177

Parameters:
  • $tags (array)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getTags()
Get the list of tags assigned to the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#186
Since:15.0.0
Returns:array
public OCP\FullTextSearch\Model\IIndexDocument::addMetaTag($tag)
Add a meta tag to the list.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#198

Parameters:
  • $tag (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::setMetaTags($tags)
Set the list of meta tags assigned to the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#209

Parameters:
  • $tags (array)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getMetaTags()
Get the list of meta tags assigned to the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#218
Since:15.0.0
Returns:array
public OCP\FullTextSearch\Model\IIndexDocument::addSubTag($sub, $tag)
Add a sub tag to the list.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#231

Parameters:
  • $sub (string)
  • $tag (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::setSubTags($tags)
Set the list of sub tags assigned to the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#242

Parameters:
  • $tags (array)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getSubTags($formatted=false)
Get the list of sub tags assigned to the original document.
If $formatted is true, the result will be formatted in a one
dimensional array.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#255

Parameters:
  • $formatted (bool)
Since:

15.0.0

Returns:

array

public OCP\FullTextSearch\Model\IIndexDocument::setSource($source)
Set the source of the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#267

Parameters:
  • $source (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getSource()
Get the source of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#276
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::setTitle($title)
Set the title of the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#288

Parameters:
  • $title (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getTitle()
Get the title of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#297
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::setContent($content, $encoded=0)
Set the content of the document.
$encoded can be NOT_ENCODED or ENCODED_BASE64 if the content is raw or
encoded in base64.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#312

Parameters:
  • $content (string)
  • $encoded (int)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getContent()
Get the content of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#321
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::isContentEncoded()
Returns the type of the encoding on the content.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#330
Since:15.0.0
Returns:int
public OCP\FullTextSearch\Model\IIndexDocument::getContentSize()
Return the size of the content.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#339
Since:15.0.0
Returns:int
public OCP\FullTextSearch\Model\IIndexDocument::initHash()
Generate an hash, based on the content of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#349
Since:15.0.0
Returns:\OCP\FullTextSearch\Model\IIndexDocument
public OCP\FullTextSearch\Model\IIndexDocument::setHash($hash)
Set the hash of the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#360

Parameters:
  • $hash (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getHash()
Get the hash of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#369
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::addPart($part, $content)
Add a part, identified by a string, and its content.
It is strongly advised to use alphanumerical chars with no space in the
$part string.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#385

Parameters:
  • $part (string)
  • $content (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::setParts($parts)
Set all parts and their content.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#396

Parameters:
  • $parts (array)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getParts()
Get all parts of the IIndexDocument.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#405
Since:15.0.0
Returns:array
Add a link, usable by the frontend.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#417

Parameters:
  • $link (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

Get the link.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#426
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::setMore($more)
Set more information that couldn’t be set using other method.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#438

Parameters:
  • $more (array)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getMore()
Get more information.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#447
Since:15.0.0
Returns:array
public OCP\FullTextSearch\Model\IIndexDocument::addExcerpt($source, $excerpt)
Add some excerpt of the content of the original document, usually based
on the search request.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#461

Parameters:
  • $source (string)
  • $excerpt (string)
Since:

16.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::setExcerpts($excerpts)
Set all excerpts of the content of the original document.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#472

Parameters:
  • $excerpts (array)
Since:

16.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getExcerpts()
Get all excerpts of the content of the original document.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#481
Since:15.0.0
Returns:array
public OCP\FullTextSearch\Model\IIndexDocument::setScore($score)
Set the score to the result assigned to this document during a search
request.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#494

Parameters:
  • $score (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getScore()
Get the score.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#503
Since:15.0.0
Returns:string
public OCP\FullTextSearch\Model\IIndexDocument::setInfo($info, $value)
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.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#520

Parameters:
  • $info (string)
  • $value (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getInfo($info, $default="")
Get an information about a document. (string)
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#532

Parameters:
  • $info (string)
  • $default (string)
Since:

15.0.0

Returns:

string

public OCP\FullTextSearch\Model\IIndexDocument::setInfoArray($info, $value)
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.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#548

Parameters:
  • $info (string)
  • $value (array)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getInfoArray($info, $default=[])
Get an information about a document. (array)
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#560

Parameters:
  • $info (string)
  • $default (array)
Since:

15.0.0

Returns:

array

public OCP\FullTextSearch\Model\IIndexDocument::setInfoInt($info, $value)
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.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#576

Parameters:
  • $info (string)
  • $value (int)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getInfoInt($info, $default=0)
Get an information about a document. (int)
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#588

Parameters:
  • $info (string)
  • $default (int)
Since:

15.0.0

Returns:

int

public OCP\FullTextSearch\Model\IIndexDocument::setInfoBool($info, $value)
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.
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#604

Parameters:
  • $info (string)
  • $value (bool)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\IIndexDocument

public OCP\FullTextSearch\Model\IIndexDocument::getInfoBool($info, $default=false)
Get an information about a document. (bool)
Source:

lib/public/FullTextSearch/Model/IIndexDocument.php#616

Parameters:
  • $info (string)
  • $default (bool)
Since:

15.0.0

Returns:

bool

public OCP\FullTextSearch\Model\IIndexDocument::getInfoAll()
Get all info.
Source:lib/public/FullTextSearch/Model/IIndexDocument.php#625
Since:15.0.0
Returns:array