Class lucene_msg

Description

The lucene msg class. This is a raw class which holds the basic message fields and data and knows how to build them into a full message for sending to the lucene server.

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

search
   |
   --lucene_connection
      |
      --lucene_msg
Direct descendents
Class Description
 class lucene_message The lucene message class. This class extends its parent class lucene_msg and adds some higher level methods for adding groups of fields to the message.
Variable Summary
 mixed $built
 mixed $error_msg
 mixed $fieldset
 mixed $type
 mixed $xmltags
Method Summary
 lucene_msg lucene_msg ([string $type = ""], [string $application = "?"], [string $host = ""], [string $port = ""])
 void add_field (string $fieldname, [string $fieldvalue = ""])
 void add_xmltag (object $tag)
 void clear ()
 void send ([integer $timeoutsecs = ""])
 void set_application (string $application)
 void set_domain (string $domain)
Variables
mixed $built = false (line 440)

True if message has been built

mixed $error_msg = "" (line 443)

Error message if any error occurred

mixed $fieldset (line 437)

Object containing lucene fields

mixed $type = "" (line 429)

Type/name of this message

mixed $xmltags = array() (line 434)

Array containing XML tags

Inherited Variables

Inherited from lucene_connection

lucene_connection::$connected
lucene_connection::$enabled
lucene_connection::$host
lucene_connection::$message
lucene_connection::$port
lucene_connection::$responsebuf
lucene_connection::$sockfp
lucene_connection::$timeoutsecs
lucene_connection::$timer

Inherited from search

search::$date_end
search::$date_fieldname
search::$date_start
search::$executed
search::$hit
search::$max_results
search::$query
search::$searchterm
search::$skip_results
search::$title
Methods
Constructor lucene_msg (line 457)

Constructor

Notes: The application is either specified in the formal paramters or it can be determined for an Axyl application by using the APP_PREFIX which is unique to the application. This is the recommended option. Other developers have, however, also used the configvalue 'Lucene Application' for some reason, so this is still supported here. If none of these methods results in a valid identifier, 'default' is used.

lucene_msg lucene_msg ([string $type = ""], [string $application = "?"], [string $host = ""], [string $port = ""])
  • string $type: Type of message this is, eg; QUERY, INDEX..
  • string $application: The application name. Sets default Lucene config.
  • string $host: Hostname or IP of Lucene server
  • string $port: Port of Lucene server
add_field (line 526)

Add a field to the fieldset.

void add_field (string $fieldname, [string $fieldvalue = ""])
  • string $fieldname: Name of the field
  • string $fieldvalue: Value to associate with this field
add_xmltag (line 487)

Add a new XML tag object to this Lucene message

void add_xmltag (object $tag)
  • object $tag: Tha xmltag object to add to our lucene msg
clear (line 532)

Clear all data/fields, leaving type definition alone.

void clear ()
send (line 571)

Sends the current message to Lucene, and checks for protocol errors in the received response.

void send ([integer $timeoutsecs = ""])
  • integer $timeoutsecs: Override for timeout in seconds

Redefinition of:
lucene_connection::send()
Sends a message to the Lucene server, and receives the response. We operate on the understanding that every time we send something to Lucene we expect a response. Since this method already calls the recieve() method, there is no need to call it from your application.

Redefined in descendants as:
  • lucene_querymsg::send() : Send the message to Lucene, and then post-process the response for
  • lucene_indexmsg::send() : 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.
  • lucene_utilitymsg::send() : Send the message to Lucene, and then post-process the response for indication of a successful utility operation. We expect to receive a response back from Lucene which has nothing much it, unless there has been an error.
set_application (line 501)

Specify the application. The application is the name of a configuration

set which has been specified either by a control message, or by using configuration files on the server. A given configuration set identified by an application name can have specific fields already defined, such as Sort: or Domain: etc. Notes: The 'Application' header can only appear once in the message.

void set_application (string $application)
  • string $application: The application name to set.
set_domain (line 518)

Specify a domain. A domain is an identifier which groups indexed objects internally to Lucene. This allows searches on multiple archives of documents in a single Lucene installation.

Notes: There may be zero or more domain headers in the message. If it does not appear, then any domain header defined for the application will be applied on its own. Otherwise any definitions added by this method are OR'd with any specified in the application config. NB: If no domains are specified anywhere, any searching will be done across all domains (which would probably yield very confusing return data!).

void set_domain (string $domain)
  • string $domain: The domain to set.

Inherited Methods

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