Word Order Matters

Rearranging your query can have quite an effect.

Who would have thought it? The order in which you put your keywords in a Google query can be every bit as important as the query words themselves. Rearranging a query can change not only your overall result count but also what results rise to the top. While one might expect this of quote-enclosed phrases—“have you any wool” versus “wool you any have”—it may come as a surprise that it also affects sets of individual query words.

Google does warn you of this right up front: “Keep in mind that the order in which the terms are typed will affect the search results.” Yet it provides little in the way of explanation or suggestion as to how best to formulate a query to take full advantage of this fact.

A little experimentation is definitely in order.

Search for the words (but not as a quote-enclosed phrase) hey diddle diddle. Figure 1-4 shows the results.

Result page for “hey diddle diddle”

Figure 1-4. Result page for “hey diddle diddle”

The top results, as expected, do include the phrase “hey diddle diddle.”

Now give diddle hey diddle a whirl. Again, it should come as no surprise that the first result contains the phrase “diddle hey diddle.” Figure 1-5 shows the results.

Result page for “diddle hey diddle”

Figure 1-5. Result page for “diddle hey diddle”

Finally, search for diddle diddle hey (Figure 1-6).

Result page for “diddle diddle hey”

Figure 1-6. Result page for “diddle diddle hey”

Another set of results, though this time it isn’t clear that Google is finding the phrase “diddle diddle hey” first. (It does show up in the third result’s snippet.)

What’s Going On?

It appears that even if you don’t specify a search as a phrase, Google accords any occurrence of the words as a phrase greater weight and more prominence. This is followed by measures of adjacency between the words and then, finally, the weights of the individual words themselves.

Strategies

Searching all query word permutations is a cumbersome thought at best. That said, it can be surprisingly effective in squeezing a few more results from the Google index. If you decide to do so, bear the following strategies in mind:

  • Try phrases with and without quotes.

  • Make your query as specific as possible, leaving fewer words and thus fewer possible permutations.

  • Try the more obvious permutation before the nonsensical—hey diddle diddle before diddle hey diddle.

Get Google Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.