posted on 6:44 PM, November 25, 2008
IntroductionExSite's content management system has a built-in search subsystem that lets you perform keyword searches across all of your content and data. Unlike external search tools such as Google, ExSite's search tools have a few useful features that take advantage of ExSite's security and content management framework:
Simply type your keywords into the search form and hit the search button to get a list of matching results on your website. Results are sorted by relevance, and the relevance score is noted so you can compare them to each other.
Relevance is increased by factors such as:
Advanced Searching Options
Search terms can optionally be prefixed with a + or - character, which changes the search rules:
These extra search controls are useful when searching for multiple terms in combination. For example:
Building A Search Index
Before you can search, you need a search index. Use the Search plug-in to create yours. You may need to grant your section permission to work with Search before you can do this:
Now you can use the Search plug-in to build a search index:
This process can create thousands of new records in your search index, so it may take a while to complete.
Repeat this process any time you want to rebuild your search index. If you notice any problems in your search index, or if your URLs are expected to change (for instance, because of a new domain name), then you will probably want to clear your search index completely before rebuilding it, so that it doesn't give spurious results.
You can also configure your site to automatically rebuild your search index whenever you publish the site. See Advanced Search Configuration, below, for more information.
Setting up a Search Page
Create a page on your site for the purpose of searching. In the body of this page, add the Search plug-in. Once you publish and/or preview this page, you will be able to enter terms into the search fields and search for matching content.
Embedded Search Forms
Many sites like to embed a search form into their margin, header, or other part of the template. Since plug-ins regenerate their own content, this can cause problems because you don't want the search results to all get stuffed into the same corner of the template as the search form.
To get around this, create a special template without the search form in the template. Use this template for your normal search page that you created, above. (You don't need the search form in the template for this page, because the Search function is located in the body.)
If you haven't already done so, configure Search to redirect all searches to this page. (Do this using the Security plug-in, as described above.) Now when you enter Search terms into a Search form in any page on your site, it will redirect to your special Search page to display the results.
Advanced Search Configuration
In your website's configuration file, you can tweak a number of search parameters to control how Search works. The defaults are given.
weight.title = 10
These define the different text elements of a page that get recorded in the search index, and how much weight (relevance) each gets in the index. You can adjust these weights if you don't like them. Change the weight to 0 (zero) if you want to exclude that part of the page from the search index.
maxresult = 25
This controls the number of search results that will be shown on a page.
no_results = Nothing relevant was found.
This is the message that is reported if Search finds nothing.
reindex_on_publish = 0
This controls whether to automatically re-index a section when you publish it. This can be quite convenient, since you don't need to remember to re-index manually, and it happens at a time when you are "certifying" all the content as good to go. However, it can be a performance drag if you regularly republish for minor reasons, so this feature is turned off by default.
Some words are ignored by Search, because they don't carry much meaning in isolation. Examples include "the", "is", "about", "and", etc. ExSite has a list of over 500 words that it does not bother to index. These words are noted in the file:
You can optionally edit this file to control which words to index and which to ignore. Or you can define your own file using a configuration setting like this:
search.skipwords = my_skipwords.txt
Searching Plug-in Data
Some plug-ins are designed to add their own items into the Search index. Examples include the e-Zine system (eg. blogs, forums), and the Catalog system (products, online shopping).
These plug-ins should have special service pages defined so that Search knows which page it should direct the reader to when they select one of these results. If you do not define a service page for a searchable plug-in, that plug-in will not bother to index its content.
best practices (5)
content management (12)
data handling (7)
graphic design (21)
html formatting (7)
plug-in modules (28)
visual tutorial (29)
web protocols (9)