This section contains a search snippet for MODx Evolution and ClipperCMS which I wrote because I wanted a lightweight and reliable search snippet. "Bells and whistles" didn't really matter to me as much as being robust.

It also aims to be reasonably intelligent in selecting results. Alot of site searches only return documents that contain all the search terms. This will give preference to such documents, but still show others. To be precise the results are ranked firstly according to whether the exact phrase entered is found, secondly according to how many of the original search terms are found, and thirdly according to the date of the last edit - on the basis that recently edited documents are more likely to be relevant on most sites.

Note that the number of different instances of the same search terms is not counted so, for example, searching for 'gold coin' prefers a document containing the exact phrase "gold coin", secondly a document containing both words separately, and lastly a document that contain numerous instances of "gold" but none of "coin" - as although its count of "gold" words may exceed the combined counts of both terms in other documents, it is far less likely to be relevant.

You set up the search form which sends the data to the search results page where the snippet lives. It is templated - although you may find the defaults quite usable - and you can choose which template variables get searched.

Help!

If you have feedback or questions please post in the first instance to the ClipperCMS forums.