Searcher.php 782 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace tw\lib\search;
  3. abstract class Searcher
  4. {
  5. /**
  6. * remove an index (container of documents)
  7. */
  8. function removeIndex(string $name)
  9. {
  10. }
  11. /**
  12. * switch current document indexing process to new index
  13. */
  14. function switchIndex(string $name)
  15. {
  16. }
  17. /**
  18. * index a document
  19. */
  20. function indexDoc(array $doc)
  21. {
  22. }
  23. /**
  24. * remove an indexed document
  25. */
  26. function removeDoc(string $docId)
  27. {
  28. }
  29. /**
  30. * rebuild all indexes of products
  31. *
  32. * internally, this will first remove all indexed docs,
  33. * and second, index products one by one(or batchly, it depends on the way the provider's API implements)
  34. *
  35. */
  36. function reindexProducts()
  37. {
  38. }
  39. }