Abstract 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.

  • abstract:
  • since: 2.5

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


	
			
Direct descendents
Class Description
 class FinderIndexerDriverMysql Indexer class supporting MySQL(i) for the Finder indexer package.
 class FinderIndexerDriverPostgresql Indexer class supporting PostgreSQL for the Finder indexer package.
 class FinderIndexerDriverSqlsrv Indexer class supporting SQL Server for the Finder indexer package.
Class Constant Summary
Variable Summary
 static object $profiler
 static object $state
Method Summary
 static string getSignature (object $item)
 static object The getState ()
 static void resetState ()
 static boolean setState (object $data)
 integer addTokensToDB (mixed $tokens, [mixed $context = ''])
 integer index (FinderIndexerResult $item, [string $format = 'html'])
 boolean optimize ()
 boolean remove (integer $linkId)
 boolean toggleTables (boolean $memory)
 integer tokenizeToDB (mixed $input, integer $context, string $lang, string $format)
Variables
static object $profiler (line 91)

The indexer profiler object.

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

The indexer state object.

  • since: 2.5
  • access: public
Methods
static getInstance (line 101)

Returns a reference to the FinderIndexer object.

  • return: instance based on the database driver
  • throws: RuntimeException if driver class for indexer not present.
  • since: 3.0
  • access: public
static FinderIndexer getInstance ()
static getSignature (line 284)

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 getState (line 138)

Method to get the indexer state.

  • return: indexer state object.
  • since: 2.5
  • access: public
static object The getState ()
static resetState (line 229)

Method to reset the indexer state.

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

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.
addTokensToDB (line 470)

Method to add a set of tokens to the database.

  • return: The number of tokens inserted into the database.
  • abstract:
  • throws: Exception on database error.
  • since: 2.5
  • access: protected
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]
index (line 250)

Method to index a content item.

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

Redefined in descendants as:
optimize (line 273)

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.
  • abstract:
  • throws: Exception on database error.
  • since: 2.5
  • access: public
boolean optimize ()
remove (line 262)

Method to remove a link from the index.

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

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.
  • abstract:
  • throws: Exception on database error.
  • since: 2.5
  • access: protected
boolean toggleTables (boolean $memory)
  • boolean $memory: Flag to control how they should be toggled.
tokenizeToDB (line 313)

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

The meta context identifier.

  • since: 2.5
MISC_CONTEXT = 5 (line 75)

The misc context identifier.

  • since: 2.5
PATH_CONTEXT = 4 (line 67)

The path context identifier.

  • since: 2.5
TEXT_CONTEXT = 2 (line 51)

The text context identifier.

  • since: 2.5
TITLE_CONTEXT = 1 (line 43)

The title context identifier.

  • since: 2.5

Documentation generated on Tue, 19 Nov 2013 15:05:31 +0100 by phpDocumentor 1.4.3