Searching CakePHP pages

CakePHP framework comes with the default PagesController which is an awesome out of the box way to build a website of mostly static pages.  There is one rather annoying limitation though – no search option.  If you need a website of mostly static pages with search functionality, you are out of luck.  I spent a good chunk of time Googling (searching, eh?) for a solution and even talking to people in #cakephp IRC channel.  The best alternatives, it turned out are listed in this StackOverflow answer:

There is no built in way to search static pages as they are just files on disk.

You have three options

  • Build a model to hold the data somewhat like a CMS so you can use mysql search.
  • google search for sites
  • the more hacky approach of reading the contents of all the pages and using preg_match() or similar on the contents to find matches.

The first option is probably the best depending on your use case. The second option is the easiest if its public facing content. The third option is a horrible idea

Since I need the solution for a public facing website, it looks like I’m gonna go with Google Custom Search Engine option.

Google authorship

For a while now I’ve been trying to have my avatar appear next to the search results leading to my blog.   There are many guides online that I’ve tried, but nothing seems to work.  I followed all the steps – verified my email, had a high quality image, linked the site to my Google+ profile, used the “by” string next to articles and the “?author” parameter in the link.  Still, no image.

Today I was looking around to see if I could find any other tip.  And apparently, there is this page now, which clarifies my problem in the first step:

Make sure you have a profile photo with a recognizable headshot.

When you put it this way, then I can see why even the high quality image wouldn’t be recognized.  It’s not a full headshot.  It’s a tight crop that computers might have a problem with, while people see.  Hopefully, this will be enough to finally sort it out.  If it will, I’ll play around with the original avatar to see how far I can take it without loosing the recognition.

Two more minor changes

I’ve done a couple of more changes to the site:

  1. Links in posts content are now bold.  This has been bugging me since the first day I started using this theme, but I never found time until now to actually fix it.  Looking through the post, links are now easily identifiable – no need to move your mouse over every word you think has a different color shade.
  2. Did some magic for Google to pick up the rich text snippet for the author.  Hopefully, after the next time it indexes the site, there will be my little avatar right next to blog links in results.  While I new the generic steps to do so, this post was helpful.  Let’s see if it works now. 

On Google’s Transparency Report

While catching up with my RSS feeds, I saw the latest Google Transparency Report from the end of last month.  The summary of the report basically says that the number of governmental requests to remove content from Google is raising quite rapidly.

transparency report 2013

There are also some clarifications of why that might be:

  • There was a sharp increase in requests from Brazil, where we received 697 requests to remove content from our platforms (of which 640 were court orders—meaning we received an average of 3.5 court orders per day during this time period), up from 191 during the first half of the year. The big reason for the spike was the municipal elections, which took place last fall. Nearly half of the total requests—316 to be exact—called for the removal of 756 pieces of content related to alleged violations of the Brazilian Electoral Code, which forbids defamation and commentary that offends candidates. We’re appealing many of these cases, on the basis that the content is protected by freedom of expression under the Brazilian Constitution.
  • Another place where we saw an increase was from Russia, where a new law took effect last fall. In the first half of 2012, we received six requests, the most we had ever received in any given six-month period from Russia. But in the second half of the year, we received 114 requests to remove content—107 of them citing this new law.
  • During this period, we received inquiries from 20 countries regarding YouTube videos containing clips of the movie “Innocence of Muslims.” While the videos were within our Community Guidelines, we restricted videos from view in several countries in accordance with local law after receiving formal legal complaints. We also temporarily restricted videos from view in Egypt and Libya due to the particularly difficult circumstances there.

One thing that I am missing is a correlation to the actual size of the Google index.  I mean, I of course understand that it is incomparably larger than all these requests combined, but I keep thinking that the more content you’ll index, the more removal requests you’ll get.  So, I think, it would be interesting to see the correlation in growth of removal requests to the growth of the Google’s global index.

Really, FairSearch?

Apparently, there is a new kid on the block – FairSearch.org. Here is a quote from their About page:

FairSearch.org is a group of businesses and organizations united to promote economic growth, innovation and choice across the Internet ecosystem by fostering and defending competition in online and mobile search. We believe in enforcement of existing laws to prevent anticompetitive behavior that harms consumers.

Further down on the same page is the list of companies involved.  Among them, some of those that should not even be allowed to use the word ‘fair’: Microsoft, Oracle, Nokia.

So, this bunch of clowns (my apologies to the clowns) tried and failed to control the web search and the mobile markets, and now they are trying to bring Google down by joining their forces and attempting a government campaign.  Pathetic!  Here is what they write to the EU:

Google’s Android is the dominant smartphone operating system, running in 70% of units shipped at the end of 2012, according to Strategy Analytics. Google also dominates mobile search advertising with 96% of the market, according to eMarketer. The complaint says Google uses deceptive conduct to lockout competition in mobile.

“Google is using its Android mobile operating system as a ‘Trojan Horse’ to deceive partners, monopolize the mobile marketplace, and control consumer data,” said Thomas Vinje, Brussels-based counsel to the FairSearch coalition. “We are asking the Commission to move quickly and decisively to protect competition and innovation in this critical market. Failure to act will only embolden Google to repeat its desktop abuses of dominance as consumers increasingly turn to a mobile platform dominated by Google’s Android operating system.”

FairSearch is an international coalition of 17 specialized search and technology companies whose members include Expedia, Microsoft, Nokia, Oracle, and TripAdvisor.

Google achieved its dominance in the smartphone operating system market by giving Android to device-makers for ‘free.’ But in reality, Android phone makers who want to include must-have Google apps such as Maps, YouTube or Play are required to pre-load an entire suite of Google mobile services and to give them prominent default placement on the phone, the complaint says. This disadvantages other providers, and puts Google’s Android in control of consumer data on a majority of smartphones shipped today.

What a load of bollocks!  Google Android devices aren’t all built by Google.  In fact, the majority of Android devices are shipped by other companies.  Are all of them producing below the cost?  Of course not.  That would just be stupid.   Secondly, Android is very much based on the Open Source Software, Linux and such.  I’m guessing that’s one of the main reasons it grows so fast and is cheaper to make.  Microsoft, Nokia, and Oracle are well-known foes of Open Source.  But guess what, it’s not up to them anymore.  People vote with the wallet.  The choice is here, and people can finally buy the devices that they like, not the ones that are being shoved down their throats.

And as far the as the web search goes, that’s even more pathetic of a subject than mobile.   Just build a better search engine and people will switch over.  It takes nothing, absolutely NOTHING, to use a different search engine. But the truth is, Google is by far superior search engine to Microsoft’s Bing or anything else that popped up recently.  Result manipulation my a$$.  If people who use the search engine will lose trust in the results, they’ll just leave.  But as long as it works, who cares really?

Goodluck Jonathan

For years Google has been working hard to bring relevant information to the user faster and faster.  One of the many features they’ve implemented was a quick look-up of a country’s president.  Just search for “russia president” or “chine president” and you’ll get name right there, on the first page of the results.  While playing around with this feature, I realized that I had no idea what’s the name of the Nigerian president is, even though I’ve heard plenty about that country.  Apparently, the Nigerian president‘s name is Goodluck Jonathan.

Microsoft catching up with Google

Way too often do I hear from the Microsoft fans that the company is catching up with Google.  Each and every time I disagreed, but in the heat of the discussion it’s not always easy to find supporting facts.  Yeah, I know, I should come ready for such arguments, but I really take them when and where they find me.

Anyways, Google Android and Microsoft Mobile is only one side of a discussion.  Advertising is the other.  And search is yet another one.  Well, I’ve heard the numbers before, but never bothered blogging them.  This time I will.  Slashdot links to a CNN Money article, which tells a really sad story.

Microsoft (MSFT, Fortune 500) has lost $5.5 billion on Bing since the search service launched in June 2009, but the company’s search losses actually pre-date that. In fact, the software giant has never made money in its online services division. Since Microsoft began breaking out that unit’s finances in 2007, the company has lost a total of $9 billion.

There is even a little visual aid in case you prefer your trends simplified.  It doesn’t look good, and it will never will.  And the secret is very simple.  Microsoft is not an online company.  It never was and it is too large to change.  If it will ever change, it will be as different from what it is now as IBM is different from the company it used to be in the last century.