phpbb\search\fulltext_postgres::index PHP Method

index() public method

Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
public index ( string $mode, integer $post_id, string &$message, string &$subject, integer $poster_id, integer $forum_id )
$mode string contains the post mode: edit, post, reply, quote ...
$post_id integer contains the post id of the post to index
$message string contains the post text of the post
$subject string contains the subject of the post to index
$poster_id integer contains the user id of the poster
$forum_id integer contains the forum id of parent forum of the post
    public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
    {
        // Split old and new post/subject to obtain array of words
        $split_text = $this->split_message($message);
        $split_title = $subject ? $this->split_message($subject) : array();
        $words = array_unique(array_merge($split_text, $split_title));
        unset($split_text);
        unset($split_title);
        // destroy cached search results containing any of the words removed or added
        $this->destroy_cache($words, array($poster_id));
        unset($words);
    }