Class FinderIndexer

Description

Main indexer class for the Finder indexer package.

The indexer class provides the core functionality of the Finder search engine. It is responsible for adding and updating the content links table; extracting and scoring tokens; and maintaining all referential information for the content.

Note: All exceptions thrown from within this class should be caught by the controller.

  • since: 2.5

Located in /administrator/components/com_finder/helpers/indexer/indexer.php (line 36)


	
			
Class Constant Summary
Variable Summary
static object $profiler
static object $state
Method Summary
static integer addTokensToDB (mixed $tokens, [mixed $context = ''])
static string getSignature (object $item)
static object The getState ()
static integer index (FinderIndexerResult $item, [string $format = 'html'])
static boolean optimize ()
static boolean remove (integer $linkId)
static void resetState ()
static boolean setState (object $data)
static boolean toggleTables (boolean $memory)
static integer tokenizeToDB (mixed $input, integer $context, string $lang, string $format)
Variables
static object $profiler (line 92)

The indexer profiler object.

  • since: 2.5
  • access: public
static object $state (line 84)

The indexer state object.

  • since: 2.5
  • access: public
Methods
static method addTokensToDB (line 1201)

Method to add a set of tokens to the database.

  • return: The number of tokens inserted into the database.
  • throws: Exception on database error.
  • since: 2.5
  • access: protected
static integer addTokensToDB (mixed $tokens, [mixed $context = ''])
  • mixed $tokens: An array or single FinderIndexerToken object.
  • mixed $context: The context of the tokens. See context constants. [optional]
static method getSignature (line 1021)

Method to get a content item's signature.

  • return: The content item's signature.
  • since: 2.5
  • access: protected
static string getSignature (object $item)
  • object $item: The content item to index.
static method getState (line 101)

Method to get the indexer state.

  • return: indexer state object.
  • since: 2.5
  • access: public
static object The getState ()
static method index (line 214)

Method to index a content item.

  • return: The ID of the record in the links table.
  • throws: Exception on database error.
  • since: 2.5
  • access: public
static integer index (FinderIndexerResult $item, [string $format = 'html'])
  • FinderIndexerResult $item: The content item to index.
  • string $format: The format of the content. [optional]
static method optimize (line 916)

Method to optimize the index. We use this method to remove unused terms and any other optimizations that might be necessary.

  • return: True on success.
  • throws: Exception on database error.
  • since: 2.5
  • access: public
static boolean optimize ()
static method remove (line 826)

Method to remove a link from the index.

  • return: True on success.
  • throws: Exception on database error.
  • since: 2.5
  • access: public
static boolean remove (integer $linkId)
  • integer $linkId: The id of the link.
static method resetState (line 193)

Method to reset the indexer state.

  • since: 2.5
  • access: public
static void resetState ()
static method setState (line 168)

Method to set the indexer state.

  • return: True on success, false on failure.
  • since: 2.5
  • access: public
static boolean setState (object $data)
  • object $data: A new indexer state object.
static method toggleTables (line 1264)

Method to switch the token tables from Memory tables to MyISAM tables when they are close to running out of memory.

  • return: True on success.
  • todo: PostgreSQL doesn't support setting ENGINEs, determine how to handle setting tables
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
static boolean toggleTables (boolean $memory)
  • boolean $memory: Flag to control how they should be toggled.
static method tokenizeToDB (line 1050)

Method to parse input, tokenize it, and then add it to the database.

  • return: The number of tokens extracted from the input.
  • since: 2.5
  • access: protected
static integer tokenizeToDB (mixed $input, integer $context, string $lang, string $format)
  • mixed $input: String or resource to use as input. A resource input will automatically be chunked to conserve memory. Strings will be chunked if longer than 2K in size.
  • integer $context: The context of the input. See context constants.
  • string $lang: The language of the input.
  • string $format: The format of the input.
Class Constants
META_CONTEXT = 3 (line 60)

The meta context identifier.

  • since: 2.5
MISC_CONTEXT = 5 (line 76)

The misc context identifier.

  • since: 2.5
PATH_CONTEXT = 4 (line 68)

The path context identifier.

  • since: 2.5
TEXT_CONTEXT = 2 (line 52)

The text context identifier.

  • since: 2.5
TITLE_CONTEXT = 1 (line 44)

The title context identifier.

  • since: 2.5

Documentation generated on Mon, 25 Jun 2012 13:55:49 -0500 by phpDocumentor 1.4.4