How to make a custom index in the catalog search correctly
Searching indexed items in the catalog using the correct type of index
Goals
I wanted to allow an editor to easily add form-like data to their plone site (Faculty Awards). The data can then be searched by guests using a customized search page, searching the awards section only. I'm using PloneFormGen and D2C to save the data, a custom python script to drop the data into the catalog, and a custom search and custom search results page. I'll have to detail the creation of this later but for now I wanted to write about a frustrating problem I couldn't find a solution for. I badgered Kim about it till he and I found a solution.
See the related items below for the link to the how-to page that describes how to add catalog indexes for your new form fields.
The Problem
Using the custom search page, searching requires you to type in an exact search match. So searching for "Faculty" would not yield a result but searching for "Faculty Member" would. Caps were also an issue, so searching for "faculty" would yield no result but searching for "Faculty" would.
My problem was that I created an index in the catalog that was a "FieldIndex" rather than a "ZCTextIndex".
The Solution
There's not much to this.
To fix:
- note the name of the FieldIndex
- delete the FieldIndex (don't worry your data wont be lost)
- add a new ZCTextIndex with the same name as the old one.
- Reindex that new index.
- Now try your search you should be able to search for either "faculty" OR "Faculty" OR "FACULTY".











