Support > Documentation > Plug-in Web Applications > System > Search

Search

The Search plug-in gives a simple interface for accessing the site search index.

The plug-in creates a simple form, allowing the user to type in any number of search terms.  It then finds all site URLs containing these terms, and ranks them according to how often the terms appear, and where in the page they appear.  The top results are displayed with their scores, and links to the actual URLs.

If you have not built a search index, Search will find nothing.  You can build your search index manually from the Search control panel.  You can also have the Search index automatically rebuilt whenever you republish, using a system configuration setting:

search.reindex_on_publish = 1

The search index keeps track of public and member-only URLs, and only displays the latter in the search results if the user is logged in.

Access

The Search plug-in is configured as a restricted-access plug-in, which means you may not have access to it by default.  To grant access to the plug-in, go into the ((Security)) plug-in, select the site, and click on Add New Website Service.  Select search from the available plug-ins.

Templating Issues

A common request is to place a search form somewhere in the page border or template, but have the search results displayed in the page body.  This is contrary to normal plug-in behaviour, where all the plug-in content is inserted into the same spot.

To get this behaviour, create your template with the search plug-in in the page border.  Also create a special page to hold the search results.  This page should NOT have the search plug-in in the page border.  Instead, you will insert it into the page body.

In the ((Security)) plug-in, you can configure the Search service, and define a special page to handle all requests to the plug-in.  Set this to use your special search page.

Now you can accept search queries on any page (using a form embedded in the template), but these requests will automatically be forwarded to the special search page, and the results will be displayed in the body.

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)