I ran into an interesting issue with Verity today. I was working on the ColdFusion Cookbook today and noticed something odd. When I did a search for file, one of the entries had this for a title: Cached File Example

I knew that couldn't be right. A quick click on the link took me here, where I saw the real title: "How can I generate static HTML from a dynamic ColdFusion page?"

I looked over my code and saw that I was passing the right information. (Obviously or my search results would have been real crazy. I then noticed something odd about this entry, inside the body was a set of html title tags. On a whim, I created a quick test:

<cfsavecontent variable="body"> hi world, how do you do today <html> <head> <title>Not the right title</title> </head>

</cfsavecontent>

<cfindex collection="test" type="custom" action="update" key="#createUUID()#" title="The Title" body="#body#" >

<cfsearch collection="test" criteria="*" name="foo" status="status"> <cfdump var="#foo#"> <cfdump var="#status#">

My first few tests simply had "hi world, how do you do today" in the body. My search results showed my hard coded title. When I added the text you see above, my hard coded title was ignored, and the title from the content was used.

A quick check of the docs for cfindex say this about the title attribute (emphasis mine):

Provides a title for the document if one cannot be extracted from the document.

So maybe this isn't a bug at all. The title is only a hint. But I can see - especially for custom data - where this would be very undesirable. For the cookbook I'm going to have to resort to using one of the custom fields, so it won't be a big deal to get around, but it is certainly something to keep in mind.