BRAIN DUMP

Thoughts, opinions and day-to-day ramblings

 Think and wonder
wonder and think. 
- Dr. Seuss

Reindexing a Perch blog

A quick note on how we've just replaced a missing index on a Perch site belonging to one of our clients.

The script below will load all posts, iterate over them and regenerate the index:

include('perch/runtime.php'); 
$API = new PerchAPI(1.0, 'perch_blog');
$Posts = new PerchBlog_Posts($API);
$posts = $Posts->all();
if (PerchUtil::count($posts)) {
	$c=1;
	foreach($posts as $Post) {
		echo "Reindexing post {$c}\n";
		$Post->index();
		$c++;
	}
}

Our Clients

A selection of the clients and brands we work with