Class lucene_indexmsg

Description

The lucene index message class. This class inherits all the functionality of the lucene_connection, lucene_msg and lucene_message classes. It adds indexing-specific methods.

Located in /lucene-defs.php (line 1022)

search
   |
   --lucene_connection
      |
      --lucene_msg
         |
         --lucene_message
            |
            --lucene_indexmsg
Variable Summary
 mixed $indexed
 mixed $serialno
Method Summary
 lucene_indexmsg lucene_indexmsg ([string $application = "?"], [string $host = ""], [string $port = ""])
 void index_content (string $id, string $content)
 void index_field (string $fieldname, string $fieldvalue)
 boolean send ([integer $timeoutsecs = ""])
Variables
Methods
Constructor lucene_indexmsg (line 1039)

Constructor Make a new Lucene index message.

lucene_indexmsg lucene_indexmsg ([string $application = "?"], [string $host = ""], [string $port = ""])
  • string $application: Optional application specifier
  • string $host: Hostname or IP of Lucene server
  • string $port: Port of Lucene server
index_content (line 1074)

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 1058)

Supply field content for indexing. This causes Lucene to take the given fieldname and index the given value against it. NB: we silently ignore the request for nullstring, since these cause Lucene 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 1091)

Send the message to Lucene, and then post-process the response for indication of a successful index operation. We expect to receive a response back from Lucene 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:
lucene_msg::send()
Sends the current message to Lucene, and checks for protocol errors in the received response.

Inherited Methods

Inherited From lucene_message

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

Inherited From lucene_msg

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

Inherited From lucene_connection

 lucene_connection::lucene_connection()
 lucene_connection::send()
 lucene_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