File/lucene-defs.php

Description
Classes
Class Description
 class lucene_connection The lucene connection class
 class lucene_msg 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.
 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.
 class lucene_querymsg The lucene query message class. This class inherits all the functionality of the lucene_connection, lucene_msg and lucene_message classes. It adds query-specific methods for searching.
 class lucene_indexmsg 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.
 class lucene_unindexmsg The lucene unindex message class. This class allows you to remove an item from the Lucene index. You must know the unique ID that identifies the document.
 class lucene_purgemsg The lucene purge message class. This class allows you to remove all
 class lucene_utilitymsg The lucene utility message class. Used for special Lucene operations.
 class lucene_search The lucene search class
 class lucene_fileindexer The lucene file indexer class.
Includes
 include_once ("search-defs.php") (line 38)

Generic search classes

 include_once ("timer-defs.php") (line 40)

Stopwatch microtimer

 include_once ("xml-defs.php") (line 42)

XML classes

Constants
DEFAULT_FIELD = "Text" (line 60)

The name of the field Lucene should assume if none specified

DEFAULT_FIELDTYPE = "Text" (line 62)

Default type of field: 'Text', 'Date', 'Id'

ID_FROM_FILENAME = 2 (line 68)

Mode of index ID generation is by full filename (incl. extension)

ID_FROM_INC = (line 64)

Mode of index ID generation is by incrementing integer

ID_FROM_NAME = 1 (line 66)

Mode of index ID generation is by filename stripped of path and extension

ID_FROM_PATH = 3 (line 70)

Mode of index ID generation is by full path to file

INDEXED = true (line 52)

Used to indicate that a field should be indexed by Lucene

META_TAG_FIELDS = true (line 72)

Indicates index fields come from meta tag extraction

NOT_INDEXED = false (line 54)

Used to indicate that a field should NOT be indexed by Lucene

NOT_STORED = false (line 58)

Used to indicate that a field should NOT be stored by Lucene

SOCK_FOREVER = 86400 (line 48)

Wait on socket forever (well, 24hrs is that, more or less)

SOCK_NO_WAIT = (line 46)

Do not wait on socket receive, return immediately

SOCK_RETRIES = 3 (line 50)

Times to retry timed-out socket sends/receives

STORED = true (line 56)

Used to indicate that a field should be stored by Lucene

Functions
lucene_backup (line 1927)

Function to make a backup of the Lucene index. This would commonly

be used after a batch of items have been successfully optimized (which indicates a sound index). The backup will be made to the directory specified in the application .properties file as the property 'Lucene-Backup-Directory=' or, if not there then in the Lucene properties file 'Server.properties' as the same property. If neither of these are defined, the server will attempt to use a sub-directory called {Lucene-Index-Directory}_backup, where {Lucene-Index-Directory} is the index path as already defined in the 'Server.properties' file.

  • return: True if the operation was successful.
boolean lucene_backup ([string $application = "?"], [string $host = ""], [string $port = ""])
  • string $application: Application name/domain name for searching in
  • string $host: Hostname or IP of Lucene server
  • string $port: Port of Lucene server
lucene_optimize (line 1905)

Function to optimize the Lucene index. This would commonly be used after a batch of items have been indexed.

  • return: True if the operation was successful.
boolean lucene_optimize ([string $application = "?"], [string $host = ""], [string $port = ""])
  • string $application: Application name/domain name for searching in
  • string $host: Hostname or IP of Lucene server
  • string $port: Port of Lucene server
lucene_purge (line 1944)

Function to purge the Lucene index of all indexes to documents. Yes, I'll repeat that - it DELETES ALL DOCUMENTS FROM THE INDEX, permanently, finito, shazam, ba-boom, as in "Omigod did I *really* mean to do that!?".

I guess I don't have to warn you to be careful with this, do I?

  • return: True if the purging operation was successful.
boolean lucene_purge ([string $application = "?"], [string $host = ""], [string $port = ""])
  • string $application: Application name/domain name for searching in
  • string $host: Hostname or IP of Lucene server
  • string $port: Port of Lucene server

Documentation generated by phpDocumentor 1.3.0RC3