benwillies.com

New Features

Advanced Search Options


All the pages in this site allow you to perform a search for specific information related to the kind of data on the page you are currently viewing. For instance, if you are reading a News article, then any search criteria you enter will be used to filter through all the Articles. For performance reasons, there is no facility for searching across all the pages of this site with a single click of the "Go" button, so you must first navigate your way to a page with the information you are interested in then do a search. When you first visit a page, it will indicate inside the search box what type of data you can filter.

The normal method of searching is to match a string of characters that you enter in the search box against all the available text information for the kind of data on that page. Depending on the amount of information that could be searched, some sites will match only on word boundaries, but smaller sites, like this one, will simply scan the entire database, matching any sequence of the search criteria regardless of whether they are complete words. The basic idea is to try and narrow the results but always try to return some results if at all possible, thereby avoiding the dreaded "Nothing found" message, although as you know, this tends to return a heck of a lot more stuff than you want.

One way to help reduce this overabundance is to better craft your search criteria according to some fairly standard principals. Google has provided some terrific instructions on how to do this so please take a minute or two to review their "Selecting Search Terms" and "Interpreting Your Query" pages. Although following Google's advice is highly recommended for all your searches on the web, you will most likely still have too many results for your liking and this is where the advanced special operators come in.

Before explaining how these operators work on this site, you may want to take another minute or two to read "Crafting Your Query by using Special Characters" by Google and "Boolean Full-Text Searches" from the MySQL Reference Manual.

As you can see by the definition, at least four of these operators (plus, minus, asterisk and quotation marks or double-quotes) have become pretty much the standard for fine-tuning searches and this site is now taking advantage of them, too. Here is the rundown...

(no operator)

Specifying a single string of letters will return any page with any word containing those letters. For example, man will match words such as man, manuals, many and permanently. If more than one word (strings of letters separated by a space) is entered, then all the pages that match any of these strings will be returned. Note that this is the opposite of Google, which assumes that your search criteria is whole words and only matches on complete words and where a page would have to contain all of the specified search words before it would be returned. Also unlike Google, hyphenated words are considered one word (or one string) such that to-date will match inception-to-date and up-to-date but not to date.

" " (quotation marks)

Use double-quotes when you want two or more words of your search criteria to be matched together, such as "advanced php", which will only return pages containing that literal string instead of all the pages that have either advanced or php. At the time of writing, using this phrase with quotes reduces the number of matches from 13 to 2 articles.

+ (plus sign)

A leading plus sign indicates that the search string must be present in every page returned. An example might be +playback cookies which will match only the one article about "Playback Controls on Forms" instead of all the other articles that talk about cookies in general. Note that there must be at least one space in front of the plus sign for it to work properly.

- (minus sign)

A leading minus sign indicates that the search string must not be present in any page returned. For instance, to narrow the results to just the one article about "Database Statistics" you could enter statistics -dns but note the space in front of the minus because without it, the entire search criteria would be treated as one long hyphenated word. Unfortunately, when searching articles, the minus sign may not always work correctly at this time, but it will work properly on all the other pages.

* (asterisk)

Substituting an asterisk for any part of your search criteria usually acts like a wildcard to match any word in a phrase, but because this site matches strings and not words, it's almost as if the asterisk is always implied between search terms anyway, so the asterisk is currently not supported as a special search operator and if entered, will be considered part of the actual search criteria (not recommended).

Of all the advanced search operators, these are the most standard and widely used. All the other operators mentioned in either the Google or MySQL pages that are not listed above are currently not supported.

When searching for articles, each word or string of letters has to be at least three letters long for it to be considered as search criteria or two letters for everything else. To force a small word to be considered, enclosed it in double-quotes or add a + prefix to it, so although it would be ignored, +it or "it" (with double-quotes) would be accepted. If one of your search terms is rejected as being too small, you will see "Small words ignored" at the bottom of your search results and if all your search criteria is too small, then you will see a "Criteria ignored" message. And please be aware that like Google and Yahoo, some commonly used words will ignored, which you can also override by enclosing them in quotes.

Exercise

Unlike the large search sites where huge numbers of results are a constant problem, the recommended approach on this site is to start with very little search criteria and through successive refinements, gradually narrow the results, so your first search should probably just be one keyword. And you never have to worry about capitalizing your search criteria since all searches are case-insensitive.

To illustrate, in the search box on the left, try the following three searches...

register
register -users
register -users +cookie

Or in the Files section, try these successive searches...

los angeles
"los angeles"
"los angeles" +star
"los angeles" -2004

Now try it out on Google or Yahoo and I think you will find the use of these special search operators an easy and effective way to help peel back that avalanche of results.


[Print Version]
Advertisement