IndexDocument¶
-
class
OC\FullTextSearch\Model\
IndexDocument
¶ - Class IndexDocumentThis is one of the main class of the FullTextSearch, used as a data transferobject. An IndexDocument is created to manage documents around FullTextSearch,during an index and during a search.The uniqueness of an IndexDocument is made by the Id of the Content Providerand the Id of the original document within the Content Provider.We will call original document the source from which the IndexDocument isgenerated. As an example, an original document can be a file, a mail, ...
Source: lib/private/FullTextSearch/Model/IndexDocument.php#50 Implements: OCP\FullTextSearch\Model\IIndexDocument
JsonSerializable
Properties¶
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
id
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#54 Type: string
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
providerId
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#57 Type: string
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
access
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#60 Type: \OC\FullTextSearch\Model\DocumentAccess
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
index
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#63 Type: \OCP\FullTextSearch\Model\IIndex
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
modifiedTime
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#66 Type: int
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
source
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#69 Type: string
Source: lib/private/FullTextSearch/Model/IndexDocument.php#72 Type: array
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
metaTags
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#75 Type: array
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
subTags
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#78 Type: array
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
title
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#81 Type: string
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
content
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#84 Type: string
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
hash
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#87 Type: string
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
parts
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#90 Type: array
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
link
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#93 Type: string
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
more
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#96 Type: array
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
excerpts
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#99 Type: array
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
score
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#102 Type: string
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
info
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#105 Type: array
-
protected static property
OC\FullTextSearch\Model\IndexDocument::$
contentEncoded
¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#108 Type: int
Methods¶
-
public
OC\FullTextSearch\Model\IndexDocument::
__construct
($providerId, $documentId)¶ - IIndexDocument constructor.On creation, we assure the uniqueness of the object using the providerIdand the Id of the original document.
Source: Parameters: - $providerId (string)
- $documentId (string)
Since: 15.0.0
-
public final
OC\FullTextSearch\Model\IndexDocument::
getId
()¶ - Returns the Id of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#135 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
getProviderId
()¶ - Returns the Id of the provider.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#147 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
setIndex
($index)¶ - Set the Index related to the IIndexDocument.
Source: Parameters: - $index (
OCP\FullTextSearch\Model\IIndex
)
See: Since: 15.0.0
Returns: - $index (
-
public final
OC\FullTextSearch\Model\IndexDocument::
getIndex
()¶ - Get the Index.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#176 Since: 15.0.0 Returns: \OCP\FullTextSearch\Model\IIndex
-
public final
OC\FullTextSearch\Model\IndexDocument::
hasIndex
()¶ - return if Index is defined.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#187 Since: 16.0.0 Returns: bool
-
public final
OC\FullTextSearch\Model\IndexDocument::
setModifiedTime
($modifiedTime)¶ - Set the modified time of the original document.
Source: Parameters: - $modifiedTime (int)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getModifiedTime
()¶ - Get the modified time of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#214 Since: 15.0.0 Returns: int
-
public final
OC\FullTextSearch\Model\IndexDocument::
isOlderThan
($time)¶ - Check if the original document of the IIndexDocument is older than $time.
Source: Parameters: - $time (int)
Since: 15.0.0
Returns: bool
-
public final
OC\FullTextSearch\Model\IndexDocument::
setAccess
($access)¶ - Set the read rights of the original document using a IDocumentAccess.
Source: Parameters: - $access (
OCP\FullTextSearch\Model\IDocumentAccess
)
See: Since: 15.0.0
Returns: $this
- $access (
-
public final
OC\FullTextSearch\Model\IndexDocument::
getAccess
()¶ - Get the IDocumentAccess related to the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#256 Since: 15.0.0 Returns: \OCP\FullTextSearch\Model\IDocumentAccess
-
public final
OC\FullTextSearch\Model\IndexDocument::
addTag
($tag)¶ - Add a tag to the list.
Source: Parameters: - $tag (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
setTags
($tags)¶ - Set the list of tags assigned to the original document.
Source: Parameters: - $tags (array)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getTags
()¶ - Get the list of tags assigned to the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#298 Since: 15.0.0 Returns: array
-
public final
OC\FullTextSearch\Model\IndexDocument::
addMetaTag
($tag)¶ - Add a meta tag to the list.
Source: Parameters: - $tag (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
setMetaTags
($tags)¶ - Set the list of meta tags assigned to the original document.
Source: Parameters: - $tags (array)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getMetaTags
()¶ - Get the list of meta tags assigned to the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#340 Since: 15.0.0 Returns: array
-
public final
OC\FullTextSearch\Model\IndexDocument::
addSubTag
($sub, $tag)¶ - Add a sub tag to the list.
Source: Parameters: - $sub (string)
- $tag (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
setSubTags
($tags)¶ - Set the list of sub tags assigned to the original document.
Source: Parameters: - $tags (array)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
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 onedimensional array.
Source: Parameters: - $formatted (bool)
Since: 15.0.0
Returns: array
-
public final
OC\FullTextSearch\Model\IndexDocument::
setSource
($source)¶ - Set the source of the original document.
Source: Parameters: - $source (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getSource
()¶ - Get the source of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#432 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
setTitle
($title)¶ - Set the title of the original document.
Source: Parameters: - $title (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getTitle
()¶ - Get the title of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#459 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
setContent
($content, $encoded=0)¶ - Set the content of the document.$encoded can be NOT_ENCODED or ENCODED_BASE64 if the content is raw orencoded in base64.
Source: Parameters: - $content (string)
- $encoded (int)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getContent
()¶ - Get the content of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#490 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
isContentEncoded
()¶ - Returns the type of the encoding on the content.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#501 Since: 15.0.0 Returns: int
-
public final
OC\FullTextSearch\Model\IndexDocument::
getContentSize
()¶ - Return the size of the content.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#512 Since: 15.0.0 Returns: int
-
public final
OC\FullTextSearch\Model\IndexDocument::
initHash
()¶ - Generate an hash, based on the content of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#524 Since: 15.0.0 Returns: \OCP\FullTextSearch\Model\IIndexDocument
-
public final
OC\FullTextSearch\Model\IndexDocument::
setHash
($hash)¶ - Set the hash of the original document.
Source: Parameters: - $hash (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getHash
()¶ - Get the hash of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#556 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
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: Parameters: - $part (string)
- $content (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
setParts
($parts)¶ - Set all parts and their content.
Source: Parameters: - $parts (array)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getParts
()¶ - Get all parts of the IIndexDocument.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#602 Since: 15.0.0 Returns: array
-
public final
OC\FullTextSearch\Model\IndexDocument::
setLink
($link)¶ - Add a link, usable by the frontend.
Source: Parameters: - $link (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getLink
()¶ - Get the link.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#629 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
setMore
($more)¶ - Set more information that couldn’t be set using other method.
Source: Parameters: - $more (array)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getMore
()¶ - Get more information.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#656 Since: 15.0.0 Returns: array
-
public final
OC\FullTextSearch\Model\IndexDocument::
addExcerpt
($source, $excerpt)¶ - Add some excerpt of the content of the original document, usually basedon the search request.
Source: Parameters: - $source (string)
- $excerpt (string)
Since: 16.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
setExcerpts
($excerpts)¶ - Set all excerpts of the content of the original document.
Source: Parameters: - $excerpts (array)
Since: 16.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getExcerpts
()¶ - Get all excerpts of the content of the original document.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#713 Since: 15.0.0 Returns: array
-
public final
OC\FullTextSearch\Model\IndexDocument::
setScore
($score)¶ - Set the score to the result assigned to this document during a searchrequest.
Source: Parameters: - $score (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getScore
()¶ - Get the score.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#760 Since: 15.0.0 Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
setInfo
($info, $value)¶ - Set some information about the original document that will be availableto the front-end when displaying search result. (as string)Because this information will not be indexed, this method can also beused to manage some data while filling the IIndexDocument before itsindexing.
Source: Parameters: - $info (string)
- $value (string)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getInfo
($info, $default="")¶ - Get an information about a document. (string)
Source: Parameters: - $info (string)
- $default (string)
Since: 15.0.0
Returns: string
-
public final
OC\FullTextSearch\Model\IndexDocument::
setInfoArray
($info, $value)¶ - Set some information about the original document that will be availableto the front-end when displaying search result. (as array)Because this information will not be indexed, this method can also beused to manage some data while filling the IIndexDocument before itsindexing.
Source: Parameters: - $info (string)
- $value (array)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getInfoArray
($info, $default=[])¶ - Get an information about a document. (array)
Source: Parameters: - $info (string)
- $default (array)
Since: 15.0.0
Returns: array
-
public final
OC\FullTextSearch\Model\IndexDocument::
setInfoInt
($info, $value)¶ - Set some information about the original document that will be availableto the front-end when displaying search result. (as int)Because this information will not be indexed, this method can also beused to manage some data while filling the IIndexDocument before itsindexing.
Source: Parameters: - $info (string)
- $value (int)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getInfoInt
($info, $default=0)¶ - Get an information about a document. (int)
Source: Parameters: - $info (string)
- $default (int)
Since: 15.0.0
Returns: int
-
public final
OC\FullTextSearch\Model\IndexDocument::
setInfoBool
($info, $value)¶ - Set some information about the original document that will be availableto the front-end when displaying search result. (as bool)Because this information will not be indexed, this method can also beused to manage some data while filling the IIndexDocument before itsindexing.
Source: Parameters: - $info (string)
- $value (bool)
Since: 15.0.0
Returns:
-
public final
OC\FullTextSearch\Model\IndexDocument::
getInfoBool
($info, $default=false)¶ - Get an information about a document. (bool)
Source: Parameters: - $info (string)
- $default (bool)
Since: 15.0.0
Returns: bool
-
public final
OC\FullTextSearch\Model\IndexDocument::
getInfoAll
()¶ - Get all info.
Source: lib/private/FullTextSearch/Model/IndexDocument.php#924 Since: 15.0.0 Returns: array
-
public
OC\FullTextSearch\Model\IndexDocument::
__destruct
()¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#945 Since: 15.0.0 On some version of PHP, it is better to force destruct the object. And during the index, the number of generated IIndexDocument can be _huge_.
-
public
OC\FullTextSearch\Model\IndexDocument::
jsonSerialize
()¶ Source: lib/private/FullTextSearch/Model/IndexDocument.php#970 Since: 15.0.0 Returns: array