Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Attributes | Private Member Functions | List of all members
eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex Class Reference

A service encapsulating database operations on ezsearch* tables. More...

## Public Member Functions
| __construct (DatabaseHandler $dbHandler)
| SearchIndex constructor. More...
| getWords (array $words)
| Fetch already indexed words from database (legacy db table: ezsearch_word). More...
| incrementWordObjectCount (array $wordId)
| Increase the object count of the given words by one. More...
| decrementWordObjectCount (array $wordId)
| Decrease the object count of the given words by one. More...
| addWords (array $words)
| Insert new words (legacy db table: ezsearch_word). More...
| purge ()
| Remove entire search index. More...
| addObjectWordLink ($wordId, $contentId, $frequency, $placement, $nextWordId, $prevWordId, $contentTypeId, $fieldTypeId, $published, $sectionId, $identifier, $integerValue, $languageMask)
| Link word with specific content object (legacy db table: ezsearch_object_word_link). More...
| getContentObjectWords ($contentId)
| Get all words related to the content object (legacy db table: ezsearch_object_word_link). More...
| deleteWordsWithoutObjects ()
| Delete words not related to any content object. More...
| deleteObjectWordsLink ($contentId)
| Delete relation between a word and a content object. More...

## Protected Attributes
| $dbHandler

## Private Member Functions
| setContentObjectWordsSelectQuery (SelectQuery $query)
| Set query selecting word ids for content object (method was extracted to be reusable). More...
| updateWordObjectCount (array $wordId, array $columns)
| Update object count for words (legacy db table: ezsearch_word). More...

## Detailed Description

A service encapsulating database operations on ezsearch* tables.

Definition at line 16 of file SearchIndex.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::__construct | ( | DatabaseHandler | $dbHandler | ) |

SearchIndex constructor.

Parameters

  \eZ\Publish\Core\Persistence\Database\DatabaseHandler | $dbHandler |

Definition at line 32 of file SearchIndex.php.

References eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\$dbHandler.

## Member Function Documentation

## ◆ addObjectWordLink()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::addObjectWordLink | ( |  | $wordId,
|  |  | $contentId,
|  |  | $frequency,
|  |  | $placement,
|  |  | $nextWordId,
|  |  | $prevWordId,
|  |  | $contentTypeId,
|  |  | $fieldTypeId,
|  |  | $published,
|  |  | $sectionId,
|  |  | $identifier,
|  |  | $integerValue,
|  |  | $languageMask
| ) |  |

Link word with specific content object (legacy db table: ezsearch_object_word_link).

Parameters

  $wordId |
  $contentId |
  $frequency |
  $placement |
  $nextWordId |
  $prevWordId |
  $contentTypeId |
  $fieldTypeId |
  $published |
  $sectionId |
  $identifier |
  $integerValue |
  $languageMask |

Definition at line 142 of file SearchIndex.php.

## ◆ addWords()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::addWords | ( | array | $words | ) |

Insert new words (legacy db table: ezsearch_word).

Parameters

  array | $words |

Definition at line 85 of file SearchIndex.php.

## ◆ decrementWordObjectCount()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::decrementWordObjectCount | ( | array | $wordId | ) |

Decrease the object count of the given words by one.

Parameters

  array | $wordId |

Definition at line 75 of file SearchIndex.php.

References eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\updateWordObjectCount().

## ◆ deleteObjectWordsLink()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::deleteObjectWordsLink | ( |  | $contentId | ) |

Delete relation between a word and a content object.

Parameters

  $contentId |

Definition at line 224 of file SearchIndex.php.

## ◆ deleteWordsWithoutObjects()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::deleteWordsWithoutObjects | ( |  | ) |

Delete words not related to any content object.

Definition at line 208 of file SearchIndex.php.

## ◆ getContentObjectWords()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::getContentObjectWords | ( |  | $contentId | ) |

Get all words related to the content object (legacy db table: ezsearch_object_word_link).

Parameters

  $contentId |

Returns
  array

Definition at line 187 of file SearchIndex.php.

References eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\setContentObjectWordsSelectQuery().

## ◆ getWords()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::getWords | ( | array | $words | ) |

Fetch already indexed words from database (legacy db table: ezsearch_word).

Parameters

  array | $words |

Returns
  array

Definition at line 45 of file SearchIndex.php.

## ◆ incrementWordObjectCount()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::incrementWordObjectCount | ( | array | $wordId | ) |

Increase the object count of the given words by one.

Parameters

  array | $wordId |

Definition at line 65 of file SearchIndex.php.

References eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\updateWordObjectCount().

## ◆ purge()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::purge | ( |  | ) |

Remove entire search index.

Definition at line 108 of file SearchIndex.php.

## ◆ setContentObjectWordsSelectQuery()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::setContentObjectWordsSelectQuery | ( | SelectQuery | $query | ) |
| private

Set query selecting word ids for content object (method was extracted to be reusable).

Parameters

  \eZ\Publish\Core\Persistence\Database\SelectQuery | $query |

Definition at line 239 of file SearchIndex.php.

References eZ\Publish\Core\Persistence\Database\SelectQuery\select().

Referenced by eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\getContentObjectWords().

## ◆ updateWordObjectCount()

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::updateWordObjectCount | ( | array | $wordId,
|  | array | $columns
| ) |  |
| private

Update object count for words (legacy db table: ezsearch_word).

Parameters

  array | $wordId | list of word IDs
  array | $columns | map of columns and values to be updated ([column => value])

Definition at line 252 of file SearchIndex.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\decrementWordObjectCount(), and eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\incrementWordObjectCount().

## Member Data Documentation

## ◆ $dbHandler

eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex::$dbHandler
| protected

Definition at line 25 of file SearchIndex.php.

Referenced by eZ\Publish\Core\Search\Legacy\Content\WordIndexer\Repository\SearchIndex\__construct().

The documentation for this class was generated from the following file:

- SearchIndex.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.