Class searchengine_message

Description

The SearchEngine message class. This class extends its parent class searchengine_msg and adds some higher level methods for adding groups of fields to the message.

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

search
   |
   --searchengine_connection
      |
      --searchengine_msg
         |
         --searchengine_message
Direct descendents
Class Description
 class searchengine_querymsg The SearchEngine query message class. This class inherits all the functionality of the searchengine_connection, searchengine_msg and searchengine_message classes. It adds query-specific methods for searching.
 class searchengine_indexmsg 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.
 class searchengine_unindexmsg The SearchEngine unindex message class. This class allows you to remove an item from the SearchEngine index. You must know the unique ID that identifies the document.
 class searchengine_utilitymsg The SearchEngine utility message class. Used for special SearchEngine operations.
Variable Summary
 mixed $response
Method Summary
 searchengine_message searchengine_message ([string $type = ""], [string $application = "?"], [string $host = ""], [string $port = ""])
 void define_field (string $fieldname, string $type, [boolean $stored = STORED], [boolean $indexed = INDEXED])
 void set_first (integer $first)
 void set_limit (integer $limit)
 void set_range ([string $range_from = ""], [string $range_to = ""], [string $range_fieldname = ""])
 void set_returnfields (mixed $fields)
 void set_sortorder (mixed $fields)
 void set_stopwords (mixed $stopwords)
Variables
Methods
Constructor searchengine_message (line 626)

Constructor This is a more complex class which builds on the basic searchengine_msg class to provide some higher level methods for adding fields in specific ways to support CONTROL, QUERY and INDEX message types.

searchengine_message searchengine_message ([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 SearchEngine config.
  • string $host: Hostname or IP of SearchEngine server
  • string $port: Port of SearchEngine server
define_field (line 697)

Define a field. We supply the name of the field, it's type (Text, Date or Id), and whether it should be stored by SearchEngine for later retreival in queries. For example you would not store the raw document/content as this is usually stored elsewhere.

We also cater for fields which might not need to be indexed. These would be fields of data you just want to return with the document, if found in a query, but not search on. An example might be a field containing the path to the physical document on disk. For these fields you would then specify NOT_INDEXED for the $indexed parameter. These fields MUST be stored, so we make the rule: if the field is NOT_INDEXED then it must be STORED (this will be forced). In the normal course of events, fields will be defined to be both stored and indexed. The exception is the special "Text" field associated with an item "Body", which is indexed, but never stored. This method adds the field settings directly via the add_field() method.

void define_field (string $fieldname, string $type, [boolean $stored = STORED], [boolean $indexed = INDEXED])
  • string $fieldname: Name of the field to index
  • string $type: Type of field data: Text, Date or Id.
  • boolean $stored: If true then SearchEngine will store the content itself
  • boolean $indexed: If true then SearchEngine will index the field content
set_first (line 747)

Specify query offset field 'First'. This sets the offset for the returned results. For example, if this was set to 3, and SearchEngine found 20 hits, then results would be sent back from the 3rd hit onwards.

void set_first (integer $first)
  • integer $first: Offset in result set to start from
set_limit (line 736)

Specify query limit field. This sets the maximum number of results that SearchEngine should return.

void set_limit (integer $limit)
  • integer $limit: Maximum number of results (hits) to return
set_range (line 793)

Specify a range on a field for querying. We specify the name of a field

which is used to select articles within the given limits, and the limits themeselves. Either limit may be passed as nullstring which indicates no limit on that side. Any dates must be passed as standard Unix timestamps (seconds since 1970). Notes: This method can be called multiple times to define additional ranges for different field names. This method adds the field setting directly via the add_field() method.

void set_range ([string $range_from = ""], [string $range_to = ""], [string $range_fieldname = ""])
  • string $range_from: Value of lowerbound range
  • string $range_to: Value of upperbound range
  • string $range_fieldname: Name of field to use in range query.
set_returnfields (line 716)

Specify the fields you want returned from SearchEngine.

Fields should be in a comma-separated list of field names. Each 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. This method adds the field setting directly via the add_field() method.

void set_returnfields (mixed $fields)
  • mixed $fields: Comma-delimited fieldname list, or array of fields
set_sortorder (line 763)

Specify the fields you want query results to be ordered by.

Fields should be in a comma-separated list of field names. Each 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. Note that sort field specification is a special case, where the syntax can be 'Foo:Date:Desc' or 'Foo:Desc' indicating the sort on the given field should be done in descending order.

void set_sortorder (mixed $fields)
  • mixed $fields: Comma-delimited fieldname list, or array of fields
set_stopwords (line 813)

Supply a stopword list to SearchEngine.

This method adds the field setting directly via the add_field() method.

void set_stopwords (mixed $stopwords)
  • mixed $stopwords: Space-delimited list, or array of stopwords

Inherited Methods

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