public function search($params, $pageSize = 20)
    {
        $query = self::find()->joinWith('author');
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => $pageSize
            ]
        ]);

        $dataProvider->setSort([
            'defaultOrder' => ['id' => SORT_DESC],
        ]);

        // load the search form data and validate
        if (!($this->load($params)))
        {
            return $dataProvider;
        }

        //adjust the query by adding the filters
        $query->andFilterWhere(['id' => $this->id]);
        $query->andFilterWhere(['like', 'username', $this->createdBy]);
        $query->orFilterWhere(['like', 'anonymousUsername', $this->createdBy]);
        $query->andFilterWhere([self::tableName().'.status' => $this->status]);
        $query->andFilterWhere(['like', 'content', $this->content]);

        return $dataProvider;
    }