Software Development Blog

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

 

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

What Our Clients Say About Us

“After ongoing issues and delays with our previous developers, we brought in Rob & Jason at Dev Partners to take over all our websites and bespoke software. What a breath of fresh air - they were fully focused, with excellent pre-launch designs and clear communication throughout. Highly recommended to anyone.”

Client logo

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.