Our Blog

Insights, perspectives, and stories on software, business, and innovation.

Read more
 

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++;
	}
}
Published

Fancy a quick chat with the software geeks?

If clunky systems are slowing you down, let’s talk. No sales patter. No corporate waffle. Just a straightforward conversation about fixing the stuff that wastes your time.

Rob and Jason - Founders of Dev Partners Ltd

Meet Rob & Jason

Two normal blokes who happen to be good at untangling messy systems. We’ll talk to you like humans, not consultants, and help you find the simplest way forward.

We’ll reply within one working day. No spam. No waffle.