[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_finder/src/Indexer/ -> Indexer.php (summary)

(no description)

Copyright: (C) 2011 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 1006 lines (37 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Indexer:: (11 methods):
  __construct()
  getState()
  setState()
  resetState()
  index()
  remove()
  optimize()
  getSignature()
  tokenizeToDb()
  tokenizeToDbShort()
  toggleTables()


Class: Indexer  - X-Ref

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.

__construct(DatabaseInterface $db = null)   X-Ref
Indexer constructor.

param: DatabaseInterface  $db  The database

getState()   X-Ref
Method to get the indexer state.

return: object  The indexer state object.

setState($data)   X-Ref
Method to set the indexer state.

param: CMSObject  $data  A new indexer state object.
return: boolean  True on success, false on failure.

resetState()   X-Ref
Method to reset the indexer state.

return: void

index($item, $format = 'html')   X-Ref
Method to index a content item.

param: Result  $item    The content item to index.
param: string  $format  The format of the content. [optional]
return: integer  The ID of the record in the links table.

remove($linkId, $removeTaxonomies = true)   X-Ref
Method to remove a link from the index.

param: integer  $linkId            The id of the link.
param: bool     $removeTaxonomies  Remove empty taxonomies
return: boolean  True on success.

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

return: boolean  True on success.

getSignature($item)   X-Ref
Method to get a content item's signature.

param: object  $item  The content item to index.
return: string  The content item's signature.

tokenizeToDb($input, $context, $lang, $format, $count = 0)   X-Ref
Method to parse input, tokenize it, and then add it to the database.

param: mixed    $input    String or resource to use as input. A resource input will automatically be chunked to conserve
param: integer  $context  The context of the input. See context constants.
param: string   $lang     The language of the input.
param: string   $format   The format of the input.
param: integer  $count    Number of words indexed so far.
return: integer  The number of tokens extracted from the input.

tokenizeToDbShort($input, $context, $lang, $format, $count)   X-Ref
Method to parse input, tokenise it, then add the tokens to the database.

param: string   $input    String to parse, tokenise and add to database.
param: integer  $context  The context of the input. See context constants.
param: string   $lang     The language of the input.
param: string   $format   The format of the input.
param: integer  $count    The number of tokens processed so far.
return: integer  Cumulative number of tokens extracted from the input so far.

toggleTables($memory)   X-Ref
Method to switch the token tables from Memory tables to Disk tables
when they are close to running out of memory.
Since this is not supported/implemented in all DB-drivers, the default is a stub method, which simply returns true.

param: boolean  $memory  Flag to control how they should be toggled.
return: boolean  True on success.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer