Class searchengine_indexmsg

Description

The SearchEngine index message class. This class inherits all the functionality of the searchengine_connection, searchengine_msg and searchengine_message classes. It adds indexing-specific methods.

Located in /search-lucene-defs.php (line 1095)

search
   |
   --searchengine_connection
      |
      --searchengine_msg
         |
         --searchengine_message
            |
            --searchengine_indexmsg
Direct descendents
Class Description
 class searchengine_indexer The indexer class. This class inherits all the functionality of the searchengine_connection, searchengine_msg and searchengine_message classes. It adds indexing-specific methods.
Variable Summary
 mixed $indexed
 mixed $serialno
Method Summary
 searchengine_indexmsg searchengine_indexmsg ([string $application = "?"], [string $host = ""], [string $port = ""], [string $serialno = ""])
 void index_content (string $id, string $content)
 void index_field (string $fieldname, string $fieldvalue)
 boolean send ([integer $timeoutsecs = ""])
Variables
Methods
Constructor searchengine_indexmsg (line 1113)

Constructor Make a new SearchEngine index message.

searchengine_indexmsg searchengine_indexmsg ([string $application = "?"], [string $host = ""], [string $port = ""], [string $serialno = ""])
  • string $application: Optional application specifier
  • string $host: Hostname or IP of SearchEngine server
  • string $port: Port of SearchEngine server
  • string $serialno: Optional specific serial number to use
index_content (line 1154)

Index the given content against the given ID. This automatically

defines the default field called "Text", and the data added as a field called "Text" as well. Attaches the "Body" tag to this field via a call to add_data() method. Thus, the content is submitted as a raw binary stream, rather than url-encoded text.

void index_content (string $id, string $content)
  • string $id: The ID to associate with the given indexed data.
  • string $content: The binary/text content to be indexed.
index_field (line 1138)

Supply field content for indexing. This causes SearchEngine to take the given fieldname and index the given value against it. NB: we silently ignore the request for nullstring, since these cause SearchEngine indexing to throw an exception, and indexing will fail.

The field name can have the field type included in the form 'Foo:Date', where 'Date' is the type in this instance. In fact, since 'Text' is the default filed type, 'Date' is probably the only one you need to use as the current implementation stands.

void index_field (string $fieldname, string $fieldvalue)
  • string $fieldname: Name of the field to index.
  • string $fieldvalue: Content of the field to index
send (line 1171)

Send the message to SearchEngine, and then post-process the response for indication of a successful index operation. We expect to receive a response back from SearchEngine which has our serialno in it. This method returns True if the indexing was successful, else False.

  • return: True if indexing was successful.
boolean send ([integer $timeoutsecs = ""])
  • integer $timeoutsecs: Override for timeout in seconds

Redefinition of:
searchengine_msg::send()
Sends the current message to SearchEngine, and checks for protocol errors in the received response.

Inherited Methods

Inherited From searchengine_message

 searchengine_message::searchengine_message()
 searchengine_message::define_field()
 searchengine_message::set_first()
 searchengine_message::set_limit()
 searchengine_message::set_range()
 searchengine_message::set_returnfields()
 searchengine_message::set_sortorder()
 searchengine_message::set_stopwords()

Inherited From searchengine_msg

 searchengine_msg::searchengine_msg()
 searchengine_msg::add_field()
 searchengine_msg::add_xmltag()
 searchengine_msg::clear()
 searchengine_msg::send()
 searchengine_msg::set_application()
 searchengine_msg::set_domain()

Inherited From searchengine_connection

 searchengine_connection::searchengine_connection()
 searchengine_connection::send()
 searchengine_connection::set_host_and_port()
 searchengine_connection::set_timeout()

Inherited From search

 search::search()
 search::clear_daterange()
 search::clear_search()
 search::does_not_match()
 search::has_daterange()
 search::hitcount()
 search::initialise()
 search::match()
 search::may_match()
 search::must_match()
 search::reset_search()
 search::set_daterange()
 search::set_maxresults()
 search::set_skipresults()
 search::termcount()

Documentation generated by phpDocumentor 1.3.0RC3