IndexDocument.php 19 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * FullTextSearch - Full text search framework for Nextcloud
  5. *
  6. * This file is licensed under the Affero General Public License version 3 or
  7. * later. See the COPYING file.
  8. *
  9. * @author Maxence Lange <maxence@artificial-owl.com>
  10. * @copyright 2018
  11. * @license GNU AGPL version 3 or any later version
  12. *
  13. * This program is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License as
  15. * published by the Free Software Foundation, either version 3 of the
  16. * License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. *
  26. */
  27. namespace OC\FullTextSearch\Model;
  28. use JsonSerializable;
  29. use OCP\FullTextSearch\Model\IDocumentAccess;
  30. use OCP\FullTextSearch\Model\IIndex;
  31. use OCP\FullTextSearch\Model\IIndexDocument;
  32. /**
  33. * Class IndexDocument
  34. *
  35. * This is one of the main class of the FullTextSearch, used as a data transfer
  36. * object. An IndexDocument is created to manage documents around FullTextSearch,
  37. * during an index and during a search.
  38. * The uniqueness of an IndexDocument is made by the Id of the Content Provider
  39. * and the Id of the original document within the Content Provider.
  40. *
  41. * We will call original document the source from which the IndexDocument is
  42. * generated. As an example, an original document can be a file, a mail, ...
  43. *
  44. * @since 15.0.0
  45. *
  46. * @package OC\FullTextSearch\Model
  47. */
  48. class IndexDocument implements IIndexDocument, JsonSerializable {
  49. /** @var string */
  50. protected $id = '';
  51. /** @var string */
  52. protected $providerId = '';
  53. /** @var DocumentAccess */
  54. protected $access;
  55. /** @var IIndex */
  56. protected $index;
  57. /** @var int */
  58. protected $modifiedTime = 0;
  59. /** @var string */
  60. protected $source = '';
  61. /** @var array */
  62. protected $tags = [];
  63. /** @var array */
  64. protected $metaTags = [];
  65. /** @var array */
  66. protected $subTags = [];
  67. /** @var string */
  68. protected $title = '';
  69. /** @var string */
  70. protected $content = '';
  71. /** @var string */
  72. protected $hash = '';
  73. /** @var array */
  74. protected $parts = [];
  75. /** @var string */
  76. protected $link = '';
  77. /** @var array */
  78. protected $more = [];
  79. /** @var array */
  80. protected $excerpts = [];
  81. /** @var string */
  82. protected $score = '';
  83. /** @var array */
  84. protected $info = [];
  85. /** @var int */
  86. protected $contentEncoded = 0;
  87. /**
  88. * IIndexDocument constructor.
  89. *
  90. * On creation, we assure the uniqueness of the object using the providerId
  91. * and the Id of the original document.
  92. *
  93. * @since 15.0.0
  94. *
  95. * @param string $providerId
  96. * @param string $documentId
  97. */
  98. public function __construct(string $providerId, string $documentId) {
  99. $this->providerId = $providerId;
  100. $this->id = $documentId;
  101. }
  102. /**
  103. * Returns the Id of the original document.
  104. *
  105. * @since 15.0.0
  106. *
  107. * @return string
  108. */
  109. final public function getId(): string {
  110. return $this->id;
  111. }
  112. /**
  113. * Returns the Id of the provider.
  114. *
  115. * @since 15.0.0
  116. *
  117. * @return string
  118. */
  119. final public function getProviderId(): string {
  120. return $this->providerId;
  121. }
  122. /**
  123. * Set the Index related to the IIndexDocument.
  124. *
  125. * @see IIndex
  126. *
  127. * @since 15.0.0
  128. *
  129. * @param IIndex $index
  130. *
  131. * @return IIndexDocument
  132. */
  133. final public function setIndex(IIndex $index): IIndexDocument {
  134. $this->index = $index;
  135. return $this;
  136. }
  137. /**
  138. * Get the Index.
  139. *
  140. * @since 15.0.0
  141. *
  142. * @return IIndex
  143. */
  144. final public function getIndex(): IIndex {
  145. return $this->index;
  146. }
  147. /**
  148. * return if Index is defined.
  149. *
  150. * @since 16.0.0
  151. *
  152. * @return bool
  153. */
  154. final public function hasIndex(): bool {
  155. return ($this->index !== null);
  156. }
  157. /**
  158. * Set the modified time of the original document.
  159. *
  160. * @since 15.0.0
  161. *
  162. * @param int $modifiedTime
  163. *
  164. * @return IIndexDocument
  165. */
  166. final public function setModifiedTime(int $modifiedTime): IIndexDocument {
  167. $this->modifiedTime = $modifiedTime;
  168. return $this;
  169. }
  170. /**
  171. * Get the modified time of the original document.
  172. *
  173. * @since 15.0.0
  174. *
  175. * @return int
  176. */
  177. final public function getModifiedTime(): int {
  178. return $this->modifiedTime;
  179. }
  180. /**
  181. * Check if the original document of the IIndexDocument is older than $time.
  182. *
  183. * @since 15.0.0
  184. *
  185. * @param int $time
  186. *
  187. * @return bool
  188. */
  189. final public function isOlderThan(int $time): bool {
  190. return ($this->modifiedTime < $time);
  191. }
  192. /**
  193. * Set the read rights of the original document using a IDocumentAccess.
  194. *
  195. * @see IDocumentAccess
  196. *
  197. * @since 15.0.0
  198. *
  199. * @param IDocumentAccess $access
  200. *
  201. * @return $this
  202. */
  203. final public function setAccess(IDocumentAccess $access): IIndexDocument {
  204. $this->access = $access;
  205. return $this;
  206. }
  207. /**
  208. * Get the IDocumentAccess related to the original document.
  209. *
  210. * @since 15.0.0
  211. *
  212. * @return IDocumentAccess
  213. */
  214. final public function getAccess(): IDocumentAccess {
  215. return $this->access;
  216. }
  217. /**
  218. * Add a tag to the list.
  219. *
  220. * @since 15.0.0
  221. *
  222. * @param string $tag
  223. *
  224. * @return IIndexDocument
  225. */
  226. final public function addTag(string $tag): IIndexDocument {
  227. $this->tags[] = $tag;
  228. return $this;
  229. }
  230. /**
  231. * Set the list of tags assigned to the original document.
  232. *
  233. * @since 15.0.0
  234. *
  235. * @param array $tags
  236. *
  237. * @return IIndexDocument
  238. */
  239. final public function setTags(array $tags): IIndexDocument {
  240. $this->tags = $tags;
  241. return $this;
  242. }
  243. /**
  244. * Get the list of tags assigned to the original document.
  245. *
  246. * @since 15.0.0
  247. *
  248. * @return array
  249. */
  250. final public function getTags(): array {
  251. return $this->tags;
  252. }
  253. /**
  254. * Add a meta tag to the list.
  255. *
  256. * @since 15.0.0
  257. *
  258. * @param string $tag
  259. *
  260. * @return IIndexDocument
  261. */
  262. final public function addMetaTag(string $tag): IIndexDocument {
  263. $this->metaTags[] = $tag;
  264. return $this;
  265. }
  266. /**
  267. * Set the list of meta tags assigned to the original document.
  268. *
  269. * @since 15.0.0
  270. *
  271. * @param array $tags
  272. *
  273. * @return IIndexDocument
  274. */
  275. final public function setMetaTags(array $tags): IIndexDocument {
  276. $this->metaTags = $tags;
  277. return $this;
  278. }
  279. /**
  280. * Get the list of meta tags assigned to the original document.
  281. *
  282. * @since 15.0.0
  283. *
  284. * @return array
  285. */
  286. final public function getMetaTags(): array {
  287. return $this->metaTags;
  288. }
  289. /**
  290. * Add a sub tag to the list.
  291. *
  292. * @since 15.0.0
  293. *
  294. * @param string $sub
  295. * @param string $tag
  296. *
  297. * @return IIndexDocument
  298. */
  299. final public function addSubTag(string $sub, string $tag): IIndexDocument {
  300. if (!array_key_exists($sub, $this->subTags)) {
  301. $this->subTags[$sub] = [];
  302. }
  303. $this->subTags[$sub][] = $tag;
  304. return $this;
  305. }
  306. /**
  307. * Set the list of sub tags assigned to the original document.
  308. *
  309. * @since 15.0.0
  310. *
  311. * @param array $tags
  312. *
  313. * @return IIndexDocument
  314. */
  315. final public function setSubTags(array $tags): IIndexDocument {
  316. $this->subTags = $tags;
  317. return $this;
  318. }
  319. /**
  320. * Get the list of sub tags assigned to the original document.
  321. * If $formatted is true, the result will be formatted in a one
  322. * dimensional array.
  323. *
  324. * @since 15.0.0
  325. *
  326. * @param bool $formatted
  327. *
  328. * @return array
  329. */
  330. final public function getSubTags(bool $formatted = false): array {
  331. if ($formatted === false) {
  332. return $this->subTags;
  333. }
  334. $subTags = [];
  335. $ak = array_keys($this->subTags);
  336. foreach ($ak as $source) {
  337. $tags = $this->subTags[$source];
  338. foreach ($tags as $tag) {
  339. $subTags[] = $source . '_' . $tag;
  340. }
  341. }
  342. return $subTags;
  343. }
  344. /**
  345. * Set the source of the original document.
  346. *
  347. * @since 15.0.0
  348. *
  349. * @param string $source
  350. *
  351. * @return IIndexDocument
  352. */
  353. final public function setSource(string $source): IIndexDocument {
  354. $this->source = $source;
  355. return $this;
  356. }
  357. /**
  358. * Get the source of the original document.
  359. *
  360. * @since 15.0.0
  361. *
  362. * @return string
  363. */
  364. final public function getSource(): string {
  365. return $this->source;
  366. }
  367. /**
  368. * Set the title of the original document.
  369. *
  370. * @since 15.0.0
  371. *
  372. * @param string $title
  373. *
  374. * @return IIndexDocument
  375. */
  376. final public function setTitle(string $title): IIndexDocument {
  377. $this->title = $title;
  378. return $this;
  379. }
  380. /**
  381. * Get the title of the original document.
  382. *
  383. * @since 15.0.0
  384. *
  385. * @return string
  386. */
  387. final public function getTitle(): string {
  388. return $this->title;
  389. }
  390. /**
  391. * Set the content of the document.
  392. * $encoded can be NOT_ENCODED or ENCODED_BASE64 if the content is raw or
  393. * encoded in base64.
  394. *
  395. * @since 15.0.0
  396. *
  397. * @param string $content
  398. * @param int $encoded
  399. *
  400. * @return IIndexDocument
  401. */
  402. final public function setContent(string $content, int $encoded = 0): IIndexDocument {
  403. $this->content = $content;
  404. $this->contentEncoded = $encoded;
  405. return $this;
  406. }
  407. /**
  408. * Get the content of the original document.
  409. *
  410. * @since 15.0.0
  411. *
  412. * @return string
  413. */
  414. final public function getContent(): string {
  415. return $this->content;
  416. }
  417. /**
  418. * Returns the type of the encoding on the content.
  419. *
  420. * @since 15.0.0
  421. *
  422. * @return int
  423. */
  424. final public function isContentEncoded(): int {
  425. return $this->contentEncoded;
  426. }
  427. /**
  428. * Return the size of the content.
  429. *
  430. * @since 15.0.0
  431. *
  432. * @return int
  433. */
  434. final public function getContentSize(): int {
  435. return strlen($this->getContent());
  436. }
  437. /**
  438. * Generate an hash, based on the content of the original document.
  439. *
  440. * @since 15.0.0
  441. *
  442. * @return IIndexDocument
  443. */
  444. final public function initHash(): IIndexDocument {
  445. if ($this->getContent() === '' || is_null($this->getContent())) {
  446. return $this;
  447. }
  448. $this->hash = hash("md5", $this->getContent());
  449. return $this;
  450. }
  451. /**
  452. * Set the hash of the original document.
  453. *
  454. * @since 15.0.0
  455. *
  456. * @param string $hash
  457. *
  458. * @return IIndexDocument
  459. */
  460. final public function setHash(string $hash): IIndexDocument {
  461. $this->hash = $hash;
  462. return $this;
  463. }
  464. /**
  465. * Get the hash of the original document.
  466. *
  467. * @since 15.0.0
  468. *
  469. * @return string
  470. */
  471. final public function getHash(): string {
  472. return $this->hash;
  473. }
  474. /**
  475. * Add a part, identified by a string, and its content.
  476. *
  477. * It is strongly advised to use alphanumerical chars with no space in the
  478. * $part string.
  479. *
  480. * @since 15.0.0
  481. *
  482. * @param string $part
  483. * @param string $content
  484. *
  485. * @return IIndexDocument
  486. */
  487. final public function addPart(string $part, string $content): IIndexDocument {
  488. $this->parts[$part] = $content;
  489. return $this;
  490. }
  491. /**
  492. * Set all parts and their content.
  493. *
  494. * @since 15.0.0
  495. *
  496. * @param array $parts
  497. *
  498. * @return IIndexDocument
  499. */
  500. final public function setParts(array $parts): IIndexDocument {
  501. $this->parts = $parts;
  502. return $this;
  503. }
  504. /**
  505. * Get all parts of the IIndexDocument.
  506. *
  507. * @since 15.0.0
  508. *
  509. * @return array
  510. */
  511. final public function getParts(): array {
  512. return $this->parts;
  513. }
  514. /**
  515. * Add a link, usable by the frontend.
  516. *
  517. * @since 15.0.0
  518. *
  519. * @param string $link
  520. *
  521. * @return IIndexDocument
  522. */
  523. final public function setLink(string $link): IIndexDocument {
  524. $this->link = $link;
  525. return $this;
  526. }
  527. /**
  528. * Get the link.
  529. *
  530. * @since 15.0.0
  531. *
  532. * @return string
  533. */
  534. final public function getLink(): string {
  535. return $this->link;
  536. }
  537. /**
  538. * Set more information that couldn't be set using other method.
  539. *
  540. * @since 15.0.0
  541. *
  542. * @param array $more
  543. *
  544. * @return IIndexDocument
  545. */
  546. final public function setMore(array $more): IIndexDocument {
  547. $this->more = $more;
  548. return $this;
  549. }
  550. /**
  551. * Get more information.
  552. *
  553. * @since 15.0.0
  554. *
  555. * @return array
  556. */
  557. final public function getMore(): array {
  558. return $this->more;
  559. }
  560. /**
  561. * Add some excerpt of the content of the original document, usually based
  562. * on the search request.
  563. *
  564. * @since 16.0.0
  565. *
  566. * @param string $source
  567. * @param string $excerpt
  568. *
  569. * @return IIndexDocument
  570. */
  571. final public function addExcerpt(string $source, string $excerpt): IIndexDocument {
  572. $this->excerpts[] =
  573. [
  574. 'source' => $source,
  575. 'excerpt' => $this->cleanExcerpt($excerpt)
  576. ];
  577. return $this;
  578. }
  579. /**
  580. * Set all excerpts of the content of the original document.
  581. *
  582. * @since 16.0.0
  583. *
  584. * @param array $excerpts
  585. *
  586. * @return IIndexDocument
  587. */
  588. final public function setExcerpts(array $excerpts): IIndexDocument {
  589. $new = [];
  590. foreach ($excerpts as $entry) {
  591. $new[] = [
  592. 'source' => $entry['source'],
  593. 'excerpt' => $this->cleanExcerpt($entry['excerpt'])
  594. ];
  595. }
  596. $this->excerpts = $new;
  597. return $this;
  598. }
  599. /**
  600. * Get all excerpts of the content of the original document.
  601. *
  602. * @since 15.0.0
  603. *
  604. * @return array
  605. */
  606. final public function getExcerpts(): array {
  607. return $this->excerpts;
  608. }
  609. /**
  610. * Clean excerpt.
  611. *
  612. * @since 16.0.0
  613. *
  614. * @param string $excerpt
  615. * @return string
  616. */
  617. final private function cleanExcerpt(string $excerpt): string {
  618. $excerpt = str_replace("\\n", ' ', $excerpt);
  619. $excerpt = str_replace("\\r", ' ', $excerpt);
  620. $excerpt = str_replace("\\t", ' ', $excerpt);
  621. $excerpt = str_replace("\n", ' ', $excerpt);
  622. $excerpt = str_replace("\r", ' ', $excerpt);
  623. $excerpt = str_replace("\t", ' ', $excerpt);
  624. return $excerpt;
  625. }
  626. /**
  627. * Set the score to the result assigned to this document during a search
  628. * request.
  629. *
  630. * @since 15.0.0
  631. *
  632. * @param string $score
  633. *
  634. * @return IIndexDocument
  635. */
  636. final public function setScore(string $score): IIndexDocument {
  637. $this->score = $score;
  638. return $this;
  639. }
  640. /**
  641. * Get the score.
  642. *
  643. * @since 15.0.0
  644. *
  645. * @return string
  646. */
  647. final public function getScore(): string {
  648. return $this->score;
  649. }
  650. /**
  651. * Set some information about the original document that will be available
  652. * to the front-end when displaying search result. (as string)
  653. * Because this information will not be indexed, this method can also be
  654. * used to manage some data while filling the IIndexDocument before its
  655. * indexing.
  656. *
  657. * @since 15.0.0
  658. *
  659. * @param string $info
  660. * @param string $value
  661. *
  662. * @return IIndexDocument
  663. */
  664. final public function setInfo(string $info, string $value): IIndexDocument {
  665. $this->info[$info] = $value;
  666. return $this;
  667. }
  668. /**
  669. * Get an information about a document. (string)
  670. *
  671. * @since 15.0.0
  672. *
  673. * @param string $info
  674. * @param string $default
  675. *
  676. * @return string
  677. */
  678. final public function getInfo(string $info, string $default = ''): string {
  679. if (!key_exists($info, $this->info)) {
  680. return $default;
  681. }
  682. return $this->info[$info];
  683. }
  684. /**
  685. * Set some information about the original document that will be available
  686. * to the front-end when displaying search result. (as array)
  687. * Because this information will not be indexed, this method can also be
  688. * used to manage some data while filling the IIndexDocument before its
  689. * indexing.
  690. *
  691. * @since 15.0.0
  692. *
  693. * @param string $info
  694. * @param array $value
  695. *
  696. * @return IIndexDocument
  697. */
  698. final public function setInfoArray(string $info, array $value): IIndexDocument {
  699. $this->info[$info] = $value;
  700. return $this;
  701. }
  702. /**
  703. * Get an information about a document. (array)
  704. *
  705. * @since 15.0.0
  706. *
  707. * @param string $info
  708. * @param array $default
  709. *
  710. * @return array
  711. */
  712. final public function getInfoArray(string $info, array $default = []): array {
  713. if (!key_exists($info, $this->info)) {
  714. return $default;
  715. }
  716. return $this->info[$info];
  717. }
  718. /**
  719. * Set some information about the original document that will be available
  720. * to the front-end when displaying search result. (as int)
  721. * Because this information will not be indexed, this method can also be
  722. * used to manage some data while filling the IIndexDocument before its
  723. * indexing.
  724. *
  725. * @since 15.0.0
  726. *
  727. * @param string $info
  728. * @param int $value
  729. *
  730. * @return IIndexDocument
  731. */
  732. final public function setInfoInt(string $info, int $value): IIndexDocument {
  733. $this->info[$info] = $value;
  734. return $this;
  735. }
  736. /**
  737. * Get an information about a document. (int)
  738. *
  739. * @since 15.0.0
  740. *
  741. * @param string $info
  742. * @param int $default
  743. *
  744. * @return int
  745. */
  746. final public function getInfoInt(string $info, int $default = 0): int {
  747. if (!key_exists($info, $this->info)) {
  748. return $default;
  749. }
  750. return $this->info[$info];
  751. }
  752. /**
  753. * Set some information about the original document that will be available
  754. * to the front-end when displaying search result. (as bool)
  755. * Because this information will not be indexed, this method can also be
  756. * used to manage some data while filling the IIndexDocument before its
  757. * indexing.
  758. *
  759. * @since 15.0.0
  760. *
  761. * @param string $info
  762. * @param bool $value
  763. *
  764. * @return IIndexDocument
  765. */
  766. final public function setInfoBool(string $info, bool $value): IIndexDocument {
  767. $this->info[$info] = $value;
  768. return $this;
  769. }
  770. /**
  771. * Get an information about a document. (bool)
  772. *
  773. * @since 15.0.0
  774. *
  775. * @param string $info
  776. * @param bool $default
  777. *
  778. * @return bool
  779. */
  780. final public function getInfoBool(string $info, bool $default = false): bool {
  781. if (!key_exists($info, $this->info)) {
  782. return $default;
  783. }
  784. return $this->info[$info];
  785. }
  786. /**
  787. * Get all info.
  788. *
  789. * @since 15.0.0
  790. *
  791. * @return array
  792. */
  793. final public function getInfoAll(): array {
  794. $info = [];
  795. foreach ($this->info as $k => $v) {
  796. if (substr($k, 0, 1) === '_') {
  797. continue;
  798. }
  799. $info[$k] = $v;
  800. }
  801. return $info;
  802. }
  803. /**
  804. * @since 15.0.0
  805. *
  806. * On some version of PHP, it is better to force destruct the object.
  807. * And during the index, the number of generated IIndexDocument can be
  808. * _huge_.
  809. */
  810. public function __destruct() {
  811. unset($this->id);
  812. unset($this->providerId);
  813. unset($this->access);
  814. unset($this->modifiedTime);
  815. unset($this->title);
  816. unset($this->content);
  817. unset($this->hash);
  818. unset($this->link);
  819. unset($this->source);
  820. unset($this->tags);
  821. unset($this->metaTags);
  822. unset($this->subTags);
  823. unset($this->more);
  824. unset($this->excerpts);
  825. unset($this->score);
  826. unset($this->info);
  827. unset($this->contentEncoded);
  828. }
  829. /**
  830. * @since 15.0.0
  831. *
  832. * @return array
  833. */
  834. public function jsonSerialize() {
  835. return [
  836. 'id' => $this->getId(),
  837. 'providerId' => $this->getProviderId(),
  838. 'access' => $this->access,
  839. 'modifiedTime' => $this->getModifiedTime(),
  840. 'title' => $this->getTitle(),
  841. 'link' => $this->getLink(),
  842. 'index' => $this->index,
  843. 'source' => $this->getSource(),
  844. 'info' => $this->getInfoAll(),
  845. 'hash' => $this->getHash(),
  846. 'contentSize' => $this->getContentSize(),
  847. 'tags' => $this->getTags(),
  848. 'metatags' => $this->getMetaTags(),
  849. 'subtags' => $this->getSubTags(),
  850. 'more' => $this->getMore(),
  851. 'excerpts' => $this->getExcerpts(),
  852. 'score' => $this->getScore()
  853. ];
  854. }
  855. }