Daemonite: Verity Optimisation Made Easy Archive

Daemonite: Verity Optimisation Made Easy Archive


Monday, September 23, 2002
Verity Optimisation Made Easy

Optimising Verity collections is so important to their performance that you really should be optimising whenever you can. On systems with a lot of collections this can seem arduous. Here are a couple of snippets to optimise your entire set of collections at once on both CF5 and CFMX.

The trick on either CF5 or CFMX is to locate where ColdFusion stores information about the available Verity collections. Once you extract that information you can loop over each collection programmatically and optimise. Don't worry about optimising a collection too often - it doesn't hurt, and if there is nothing to do CF quickly moves onto the next collection.

ColdFusion 5 and below
Earlier versions of ColdFusion stored Verity information in the Registry. This is either the Windows Registry or the emulated registry on *nix systems. Using CFREGISTRY you can grab the appropriate branch and get the information you need.

ColdFusion MX
With the move to MX, Macromedia have tried to remove all dependency on the registry, even deprecating the CFREGISTRY tag in *nix systems. You now have to locate an inconspicuous XML config file to determine the local Verity collection information.

I haven't had much time to trial the CFMX Verity optimising routine on many systems - but it appears to work well enough. Let me know if you encounter any issues so I can update my script.

Posted by modius at 07:42 AM | Permalink
Trackback: http://blog.daemon.com.au/cgi-bin/dmblog/mt-tb.cgi/43

Comments

Hi Geoff,

I've been working on a verity package recently and found you can use cfcollection action=list to return a query object with all the collections present. List is new in cfmx for cfcollection.

I thought it may make the cffile code a little more portable. And you don't have to convert the wddx packet etc.

This is a revised example of your code with the new function:

<cfcollection action="list" name="qryCols">

<cfloop query="qryCols">
   <cfif not qryCols.external>
     <cfcollection action="optimize" collection="#qryCols.name#">
     <cfoutput>#qryCols.name# optimsed....<br></cfoutput>
     <cfflush interval="1">
   </cfif>
</cfloop>

There is also a new catch type=searchEngine that does't come up in dwmx to catch search engine specific errors, this could be added to your try catches.

Posted by: John on October 13, 2002 02:18 PM

Thanks John, well spotted!

Posted by: Geoff Bowers on October 13, 2002 03:54 PM

Thanks a ton for this code guys... so I've got my Verity collections optimized, and a full text search is still taking approximately 250 to 400 ms per search. 250 ms to 400 ms is too long... anyone got any suggestions as to speeding up verity searches (besides getting a new machine)?

Posted by: Aaron Johnson on March 6, 2003 10:40 AM

Forget optimization code, I'm just pleased someone out there could tell me how to get a list of existing collections on CF5 :> Thanks a lot.

Posted by: Michelle on May 27, 2003 09:14 AM

ok... I have a question... What is up with Verity and the summury? it shows everything... at the file level... that sucks... I don't want to display the HTML... especially any Coldfusion info... just the HTML output.

People say K2 is the way to go with a spider.. but I have been trying to get that to work for weeks. Any step by step guide for idiots like me to set up K2 verity on MX? I have lots of sites on this box that need to use it. please help!

Thanks! (Please email me if you can)

Posted by: d-man on July 2, 2003 01:14 AM