1
0

IIndexService.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\FullTextSearch\Service;
  8. use OCP\FullTextSearch\Model\IIndex;
  9. /**
  10. * Interface IIndexService
  11. *
  12. * @since 15.0.0
  13. *
  14. */
  15. interface IIndexService {
  16. /**
  17. * Create an Index
  18. *
  19. * @since 15.0.1
  20. *
  21. * @param string $providerId
  22. * @param string $documentId
  23. * @param string $userId
  24. * @param int $status
  25. * @return IIndex
  26. */
  27. public function createIndex(string $providerId, string $documentId, string $userId, int $status): IIndex;
  28. /**
  29. * Retrieve an Index from the database, based on the Id of the Provider
  30. * and the Id of the Document
  31. *
  32. * @since 15.0.0
  33. *
  34. * @param string $providerId
  35. * @param string $documentId
  36. *
  37. * @return IIndex
  38. */
  39. public function getIndex(string $providerId, string $documentId): IIndex;
  40. /**
  41. * Update the status of an Index. status is a bit flag, setting $reset to
  42. * true will reset the status to the value defined in the parameter.
  43. *
  44. * @since 15.0.0
  45. *
  46. * @param string $providerId
  47. * @param string $documentId
  48. * @param int $status
  49. * @param bool $reset
  50. */
  51. public function updateIndexStatus(string $providerId, string $documentId, int $status, bool $reset = false);
  52. /**
  53. * Update the status of an array of Index. status is a bit flag, setting $reset to
  54. * true will reset the status to the value defined in the parameter.
  55. *
  56. * @since 15.0.0
  57. *
  58. * @param string $providerId
  59. * @param array $documentIds
  60. * @param int $status
  61. * @param bool $reset
  62. */
  63. public function updateIndexesStatus(string $providerId, array $documentIds, int $status, bool $reset = false);
  64. /**
  65. * Update an array of Index.
  66. *
  67. * @since 15.0.0
  68. *
  69. * @param array $indexes
  70. */
  71. public function updateIndexes(array $indexes);
  72. }