Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
141 views
in Q2A Core by
How to forbid index content when post questions

I found it will be very slow when open index function , so i want forbid this function, is there anyone can tell me how to do this?

thanks
Q2A version: 1.8.5

1 Answer

0 votes
by

 What functions would be affected if I commented out the following code in "db/post-create.php"?

Is it can forbid to insert content words index into db? 

and is it will affact search funtion? 

As the content words index cost much time and much db space when posts in large num, so I want forbid index content words function, only leave other index funtion. Does can meet my requirement?

/**

 * Add rows into the database content index, where $postid (of $type, with the antecedent $questionid)

 * has words as per the keys of $wordidcounts, and the corresponding number of those words in the values.

 * @param $postid

 * @param $type

 * @param $questionid

 * @param $wordidcounts

 */

function qa_db_contentwords_add_post_wordidcounts($postid, $type, $questionid, $wordidcounts)

{

if (count($wordidcounts)) {

$rowstoadd = array();

foreach ($wordidcounts as $wordid => $count) {

if ($count > QA_DB_MAX_WORD_COUNT) {

$count = QA_DB_MAX_WORD_COUNT;

}

$rowstoadd[] = array($postid, $wordid, $count, $type, $questionid);

}

qa_db_query_sub(

'INSERT INTO ^contentwords (postid, wordid, count, type, questionid) VALUES #',

$rowstoadd

);

}

}

...