2019-02-20 13:38:19 +03:00
|
|
|
<?php
|
|
|
|
|
2019-12-03 21:57:53 +03:00
|
|
|
declare(strict_types=1);
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
2019-12-03 21:57:53 +03:00
|
|
|
* @copyright 2018
|
2019-02-20 13:38:19 +03:00
|
|
|
*
|
2020-04-29 12:57:22 +03:00
|
|
|
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
2019-02-20 13:38:19 +03:00
|
|
|
* @author Maxence Lange <maxence@artificial-owl.com>
|
2019-12-03 21:57:53 +03:00
|
|
|
*
|
2019-02-20 13:38:19 +03:00
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2019-02-20 13:38:19 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCP\FullTextSearch\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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, ...
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*/
|
|
|
|
interface IIndexDocument {
|
2020-04-10 17:54:27 +03:00
|
|
|
public const NOT_ENCODED = 0;
|
|
|
|
public const ENCODED_BASE64 = 1;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Id of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getId(): string;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Id of the provider.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getProviderId(): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the Index related to the IIndexDocument.
|
|
|
|
*
|
|
|
|
* @see IIndex
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param IIndex $index
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setIndex(IIndex $index): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Index.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return IIndex
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getIndex(): IIndex;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* return if Index is defined.
|
|
|
|
*
|
|
|
|
* @since 16.0.0
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function hasIndex(): bool;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the modified time of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param int $modifiedTime
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setModifiedTime(int $modifiedTime): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the modified time of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getModifiedTime(): int;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if the original document of the IIndexDocument is older than $time.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param int $time
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function isOlderThan(int $time): bool;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the read rights of the original document using a IDocumentAccess.
|
|
|
|
*
|
|
|
|
* @see IDocumentAccess
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param IDocumentAccess $access
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setAccess(IDocumentAccess $access): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the IDocumentAccess related to the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return IDocumentAccess
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getAccess(): IDocumentAccess;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a tag to the list.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $tag
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function addTag(string $tag): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the list of tags assigned to the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param array $tags
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setTags(array $tags): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the list of tags assigned to the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getTags(): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a meta tag to the list.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $tag
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function addMetaTag(string $tag): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the list of meta tags assigned to the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param array $tags
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setMetaTags(array $tags): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the list of meta tags assigned to the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getMetaTags(): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a sub tag to the list.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $sub
|
|
|
|
* @param string $tag
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function addSubTag(string $sub, string $tag): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the list of sub tags assigned to the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param array $tags
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setSubTags(array $tags): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param bool $formatted
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getSubTags(bool $formatted = false): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the source of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $source
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setSource(string $source): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the source of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getSource(): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the title of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $title
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setTitle(string $title): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the title of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getTitle(): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the content of the document.
|
|
|
|
* $encoded can be NOT_ENCODED or ENCODED_BASE64 if the content is raw or
|
|
|
|
* encoded in base64.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $content
|
|
|
|
* @param int $encoded
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setContent(string $content, int $encoded = 0): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the content of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getContent(): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the type of the encoding on the content.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function isContentEncoded(): int;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the size of the content.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getContentSize(): int;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate an hash, based on the content of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function initHash(): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the hash of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $hash
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setHash(string $hash): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the hash of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getHash(): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $part
|
|
|
|
* @param string $content
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function addPart(string $part, string $content): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set all parts and their content.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param array $parts
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setParts(array $parts): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all parts of the IIndexDocument.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getParts(): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a link, usable by the frontend.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $link
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setLink(string $link): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the link.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getLink(): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set more information that couldn't be set using other method.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param array $more
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setMore(array $more): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get more information.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getMore(): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add some excerpt of the content of the original document, usually based
|
|
|
|
* on the search request.
|
|
|
|
*
|
|
|
|
* @since 16.0.0
|
|
|
|
*
|
|
|
|
* @param string $source
|
|
|
|
* @param string $excerpt
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function addExcerpt(string $source, string $excerpt): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set all excerpts of the content of the original document.
|
|
|
|
*
|
|
|
|
* @since 16.0.0
|
|
|
|
*
|
|
|
|
* @param array $excerpts
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setExcerpts(array $excerpts): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all excerpts of the content of the original document.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getExcerpts(): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the score to the result assigned to this document during a search
|
|
|
|
* request.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $score
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setScore(string $score): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the score.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getScore(): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param string $value
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setInfo(string $info, string $value): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an information about a document. (string)
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param string $default
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getInfo(string $info, string $default = ''): string;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param array $value
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setInfoArray(string $info, array $value): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an information about a document. (array)
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param array $default
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getInfoArray(string $info, array $default = []): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param int $value
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setInfoInt(string $info, int $value): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an information about a document. (int)
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param int $default
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getInfoInt(string $info, int $default = 0): int;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param bool $value
|
|
|
|
*
|
|
|
|
* @return IIndexDocument
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function setInfoBool(string $info, bool $value): IIndexDocument;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get an information about a document. (bool)
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @param string $info
|
|
|
|
* @param bool $default
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getInfoBool(string $info, bool $default = false): bool;
|
2019-02-20 13:38:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all info.
|
|
|
|
*
|
|
|
|
* @since 15.0.0
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2020-04-10 15:19:56 +03:00
|
|
|
public function getInfoAll(): array;
|
2019-02-20 13:38:19 +03:00
|
|
|
}
|