Support > Documentation > Content Management > Using Search

Using Search

Introduction

ExSite'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:
  • Your site is re-indexed when you decide, rather than when the robots get around to it.
  • You can index private (member-only) pages, which external search tools cannot see.  Search results for private pages are only displayed if the user is logged in.
  • Your search terms are automatically weighted by their meaning and relevance in the page.
  • Your plug-ins can add their own items to the search index.
  • Your search index can be edited.
Use the Search plug-in to embed the search feature into your web site.

Visual Tutorials

Info

Performing Searches

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:
  • your terms appear in titles and other important parts of the page
  • your terms appear repeatedly in the page
  • more than one of your terms appear in the page (if you entered more than one term)
Very roughly, a relevance score of 1 means your search term appeared once in the body of the page.  Higher scores mean that it appeared more often, or appeared in more important parts of the page.

Advanced Searching Options

Search terms can optionally be prefixed with a + or - character, which changes the search rules:

term The term is desired, but optional, in the search results. In other words, if more than one term is given, at least one of them is required in each result.  (But if you only provide one term, that is effectively the same as it being required.)
+term The term is required in the search results. Results that do not contain this term will not be reported. 
-term The term is forbidden in the search results. Results that contain this term will not be reported.  This must be combined with one of the above options;  it cannot be used by itself.

These extra search controls are useful when searching for multiple terms in combination. For example:

foo bar Search for foo OR bar.  Pages that contain either term will appear in the results, but pages with both terms will tend to be more relevant.
+foo +bar Search for foo AND bar.  Only pages that contain both terms will appear in the results.
+foo bar Search for foo and optionally bar.  Only pages that contain foo will appear in the results, but if the pages also contain bar, they will be more relevant.
foo -bar Search for pages containing foo, but exclude pages containing bar from the results.

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:
  1. Launch the Security plug-in.
  2. Select your site or section.
  3. If Search is not listed as one of the services for this section, then add it. You can optionally define a special page on which all search results should be displayed.  (See "Embedded Search Forms" below for more information.)
  4. Refresh your webtop if necessary, to see the Search plug-in.
Now you can use the Search plug-in to build a search index:
  1. Launch the Search plug-in.
  2. Select your section from those available.
  3. Click on "Build index for selected site".
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.

Weights

weight.title = 10
weight.filename = 5
weight.keywords = 5
weight.description = 3
weight.body = 1

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.

Results Listings

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.

Indexing

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.

Skipwords

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:
cgi/conf/skipwords.txt
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.

Topics

google (5 items)
RSS (3 items)
SEO (3 items)
plug-in modules (28 items)
IT (9 items)
best practices (5 items)
visual tutorial (29 items)
security (3 items)
data handling (7 items)
fundamentals (3 items)
graphic design (19 items)
web protocols (9 items)
programming (48 items)
html formatting (7 items)
POD (32 items)
events (8 items)