Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
__construct (DatabaseInterface $db=null) | |
index ($item, $format='html') | |
remove ($linkId, $removeTaxonomies=true) | |
optimize () | |
Fonctions membres publiques statiques | |
static | getState () |
static | setState ($data) |
static | resetState () |
Champs de données | |
const | TITLE_CONTEXT = 1 |
const | TEXT_CONTEXT = 2 |
const | META_CONTEXT = 3 |
const | PATH_CONTEXT = 4 |
const | MISC_CONTEXT = 5 |
Attributs publics statiques | |
static | $state |
static | $profiler |
Fonctions membres protégées | |
tokenizeToDb ($input, $context, $lang, $format, $count=0) | |
toggleTables ($memory) | |
Fonctions membres protégées statiques | |
static | getSignature ($item) |
Attributs protégés | |
$db | |
$addTokensToDbQueryTemplate | |
Fonctions membres privées | |
tokenizeToDbShort ($input, $context, $lang, $format, $count) | |
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 | ) |
Indexer constructor.
DatabaseInterface | $db | The database |
Références $db, class, Factory\getContainer(), et null.
|
staticprotected |
Method to get a content item's signature.
object | $item | The content item to index. |
Références $config, $item, $state, et Joomla\CMS\MVC\Model\getState().
|
static |
Method to get the indexer state.
Try to calculate the heapsize for the memory table for indexing. If this fails, we fall back on a reasonable small size. We want to prevent the system to fail and block saving content.
In tests, the size of a row seems to have been around 720 bytes. We take 800 to be on the safe side.
Références $data, $db, $state, Factory\getApplication(), Factory\getDate(), Factory\getDbo(), Profiler\getInstance(), ComponentHelper\getParams(), Factory\getSession(), et null.
Référencé par IndexerController\batch(), FinderIndexCommand\index(), IndexerController\optimize(), et IndexerController\start().
index | ( | $item, | |
$format = 'html' |
|||
) |
Method to index a content item.
Result | $item | The content item to index. |
string | $format | The format of the content. [optional] |
Références $context, $count, $db, $format, $item, $link, $query, $state, Taxonomy\addMap(), Taxonomy\addNestedNode(), Taxonomy\addNode(), Factory\getApplication(), Factory\getDate(), Joomla\CMS\MVC\Model\getState(), PluginHelper\importPlugin(), ParameterType\INTEGER, ParameterType\LARGE_OBJECT, null, Helper\parse(), Taxonomy\removeMaps(), File\stripExt(), et StringHelper\substr().
optimize | ( | ) |
Method to optimize the index. We use this method to remove unused terms and any other optimizations that might be necessary.
Exception | on database error. |
Références $db, $query, Taxonomy\removeOrphanMaps(), et Taxonomy\removeOrphanNodes().
remove | ( | $linkId, | |
$removeTaxonomies = true |
|||
) |
Method to remove a link from the index.
integer | $linkId | The id of the link. |
bool | $removeTaxonomies | Remove empty taxonomies |
Exception | on database error. |
Références $db, $query, Factory\getApplication(), PluginHelper\importPlugin(), ParameterType\INTEGER, Taxonomy\removeMaps(), et Taxonomy\removeOrphanNodes().
|
static |
Method to reset the indexer state.
Références $state, Factory\getSession(), et null.
Référencé par FinderIndexCommand\index(), et IndexerController\start().
|
static |
Method to set the indexer state.
CMSObject | $data | A new indexer state object. |
Références $data, $state, et Factory\getSession().
Référencé par IndexerController\batch().
|
protected |
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.
boolean | $memory | Flag to control how they should be toggled. |
Exception | on database error. |
|
protected |
Method to parse input, tokenize it, and then add it to the database.
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. |
integer | $count | Number of words indexed so far. |
Références $buffer, $context, $count, $format, $input, $lang, null, et StringHelper\trim().
|
private |
Method to parse input, tokenise it, then add the tokens to the database.
string | $input | String to parse, tokenise and add to database. |
integer | $context | The context of the input. See context constants. |
string | $lang | The language of the input. |
string | $format | The format of the input. |
integer | $count | The number of tokens processed so far. |
Références $context, $count, $format, $input, $lang, $params, $query, $state, ComponentHelper\getParams(), null, Helper\parse(), et Helper\tokenize().
|
protected |
|
protected |
|
static |
|
static |
const META_CONTEXT = 3 |
const MISC_CONTEXT = 5 |
const PATH_CONTEXT = 4 |
const TEXT_CONTEXT = 2 |
const TITLE_CONTEXT = 1 |