Source for file search-index-defs.php

Documentation is available at search-index-defs.php

  1. <?php
  2. /* ******************************************************************** */
  3. /* CATALYST PHP Source Code */
  4. /* -------------------------------------------------------------------- */
  5. /* This program is free software; you can redistribute it and/or modify */
  6. /* it under the terms of the GNU General Public License as published by */
  7. /* the Free Software Foundation; either version 2 of the License, or */
  8. /* (at your option) any later version. */
  9. /* */
  10. /* This program is distributed in the hope that it will be useful, */
  11. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  12. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  13. /* GNU General Public License for more details. */
  14. /* */
  15. /* You should have received a copy of the GNU General Public License */
  16. /* along with this program; if not, write to: */
  17. /* The Free Software Foundation, Inc., 59 Temple Place, Suite 330, */
  18. /* Boston, MA 02111-1307 USA */
  19. /* -------------------------------------------------------------------- */
  20. /* */
  21. /* Filename: search-index-defs.php */
  22. /* Author: Paul Waite */
  23. /* Description: Definitions for interfacing to a search engine to */
  24. /* perform indexing operations. */
  25. /* The parent module which includes this module must also */
  26. /* include the underlying defs module for the search */
  27. /* engine itself, eg: lucene, solr etc. */
  28. /* */
  29. /* ******************************************************************** */
  30. /** @package search */
  31. include_once("search-defs.php");
  32.  
  33. // ----------------------------------------------------------------------
  34. /**
  35. * The indexer class. This class inherits all the functionality
  36. * of the searchengine_connection, searchengine_msg and searchengine_message
  37. * classes. It adds indexing-specific methods.
  38. * @package search
  39. */
  40. class searchengine_indexer extends searchengine_indexmsg {
  41. // .....................................................................
  42. /** Constructor
  43. * Make a new SearchEngine indexer.
  44. * @param string $application Optional application specifier
  45. * @param string $host Hostname or IP of SearchEngine server
  46. * @param string $port Port of SearchEngine server
  47. * @param string $serialno Optional specific serial number to use
  48. */
  49. function searchengine_indexer($application="?", $host="", $port="", $serialno="") {
  50. $this->searchengine_indexmsg($application, $host, $port, $serialno);
  51. } // searchengine_indexer
  52.  
  53. // .....................................................................
  54. /**
  55. * Make SearchEngine execute the indexing funtion for the document.
  56. * @param integer $timeoutsecs Override for timeout in seconds
  57. * @return boolean True if indexing was successful.
  58. */
  59. function execute($timeoutsecs="") {
  60. return $this->send($timeoutsecs);
  61. } // execute
  62.  
  63. } // searchengine_indexer class
  64. // ----------------------------------------------------------------------
  65.  
  66. /**
  67. * The SearchEngine unindexer class. This class allows you to remove an
  68. * item from the SearchEngine index. You must know the unique ID that identifies
  69. * the document.
  70. * @package search
  71. */
  72. class searchengine_unindexer extends searchengine_unindexmsg {
  73. // .....................................................................
  74. /** Constructor
  75. * Make a new SearchEngine unindexer. This is provided to allow you to
  76. * delete an item from the SearchEngine index. It has a single method
  77. * 'unindex' which takes the ID of the item to delete.
  78. * @param string $application Optional application specifier
  79. * @param string $host Hostname or IP of SearchEngine server
  80. * @param string $port Port of SearchEngine server
  81. */
  82. function searchengine_unindexer($application="?", $host="", $port="") {
  83. $this->searchengine_unindexmsg($application, $host, $port);
  84. } // searchengine_unindexer
  85. // .....................................................................
  86. /**
  87. * Unindex the given document, as identified by the unique ID. If no errors
  88. * arise, then the item will be removed from the SearchEngine index.
  89. * @param string $id The ID to allow SearchEngine to identify the item to unindex
  90. */
  91. function execute($timeoutsecs="") {
  92. return $this->send($timeoutsecs);
  93. } // execute
  94.  
  95. } // searchengine_unindexer class
  96. // ----------------------------------------------------------------------
  97.  
  98. ?>

Documentation generated by phpDocumentor 1.3.0RC3