Understanding ColdFusion

Setting Up the ColdFusion Verity Search Engine

About 4 min read

ColdFusion includes the Verity search engine which allows you to easily provide search capabilities to your Web site. The process of setting up the Verity search engine in a web site consists of:
  1. Create Verity files through the Server Administrator on your PC and/or the ColdFusion server.
  2. Create Verity pages for the web site with the ColdFusion Studio Verity Wizard.
  3. Make adjustments to file locations.

This lesson will explain those steps. There is a mini-quiz at the end of the lesson.

Create Verity collection

In order to use Verity, you need a location to store the necessary collection of files for the search engine. You create the necessary files in this location with the ColdFusion Server Administrator. You can do this on your PC and your host administrator can do this on the ColdFusion server.

The method to do this is:

  1. Open the Server Administrator, enter your password and choose Verity underMiscellaneous from the menu on the side.
  2. In the Add a Collection form, enter a unique name and location. On a PC, the location would typically at C:/CFusion/Verity/Collections/unique_name. The administrator of your CF server would have a similar location.

A folder with that name and associated sub-folders will be created.

Creating Verity pages

You can use the Verity Wizard in ColdFusion Studio to create the pages required to perform your search. It is easy to do this on your PC. You can then test them and upload the files to the CF server, or you can perform the process directly online.

Select File > New, click the CFML tab, and choose Verity Wizard. As you go through the Wizard, you can opt to place your four Verity search files in the root directory of your Web site or some sub-folder of your choice.

The following four files are created in your web site root directory:

  • search_name_VOpenFile.cfm
  • search_name_VPathIndexing.cfm
  • search_name_VSearchForm.cfm
  • search_name_VSearchResult.cfm

Make adjustments

It is not a bad idea to check your files to make adjustments, especially if you plan to upload them to the server.

Change to relative locations

Within each the the Verify files, change the indicated tags to relative locations.

search_name_VOpenFile.cfm

It isn’t a bad idea to change <CFSET WorkingDirectory = XXX> to a relative file, instead of naming the drive and such.

search_name_VPathIndexing.cfm

Likewise, change <CFSET IndexDirectory = XXX> to a relative location.

search_name_VSearchForm.cfm

Likewise, change <CFSET SearchDirectory = XXX> to a relative location.

Also change MyApplication_VOpenFile.cfm to include name of your application (i.e. search_name)

search_name_VSearchResult.cfm

Likewise, change <CFSET SearchDirectory = XXX> to a relative location.

Problems

I had some problems in search_name_VSearchForm.cfm, with:

<TR bgcolor=”#IIf(CurrentRow Mod 2, DE(‘#FFFFFF’), DE(‘#FFFFCF’))#”>
which is underneath
<CFOUTPUT query=”GetResults” maxRows=”#Form.MaxRows#”>.

which gave error messages. This is because the color codes (i.e. #FFFFF) need an extra # (i.e. ##FFFFF) to work properly when part of a statement enclosed between two #s. You can add the extra #s or simply delete the <TR bgcolor=…> and the problem goes away.

In conclusion

The process to set up and use the Verity search engine is relatively straightforward. It seems to do a fairly good job of searching the site and presenting an output..


If you are reliable, you are valuable


Search

Mini-quiz to check your understanding

(Note: Your browser must be able to use JavaScript for this quiz to function properly.)

QUIZ

Self-check your understanding

  1. What is the usual way of submitting a form?

  2. Where do you put the form you will submit?

  3. Must you use IsDefined("form.submit")?

Pick an answer to see instant feedback. Re-read the lesson if you miss one.

If you got all three correct, you are on your way to becoming a champion in ColdFusion development. If you had problems, you had better look over the material again.


What do you think?

Feel free to establish a link from your web site to pages in this site.



Enter one or more keywords to search the School for Champions site and find related lessons: