Tuesday, August 21, 2007

Verity Collection Creation Error

When creating Verity collections, you may get this error from time to time.

ERROR
An error occurred while performing an operation in the Search Engine library.
Error opening the collection: com.verity.organize.WorkSpaceException: Path not found [VdkError_PathNotFound]. (-104)

ANOTHER RELATED ERROR
If you go into your CFADMIN and click on Verity, you may get the following message.

Unable to retrieve collections from the Search Service.
Please verify that the ColdFusion Search Server is installed and running.

I found that the problem was in the creation of the "bookclub" collection on new CF installs. However, if you have a collection gone wild, this is how you can fix it.

FIX TO BOTH ERRORS

1. Delete the collection(s) definition(s) via code or from the verity admin in CFADMIN if you can. If you can't see the collections do it via the code below.
VERITY COLLECTIONS BEFORE PURGE
<cfdirectory action="LIST" directory="[CFINSTALL]/verity/collections" name="GetCols">
<cfdump var="#GetCols#">
<br>

DELETE ALL COLLECTIONS
<cfoutput query="GetCols">
<cfif GetCols.name DOES NOT CONTAIN ".">
<cfcollection action="DELETE" collection="#GetCols.name#" path="[
CFINSTALL]/verity/collections/#GetCols.name#">
"#GetCols.name#" collection removed<br><br>
</cfif>
</cfoutput>

VERITY COLLECTIONS AFTERPURGE
<cfdirectory action="LIST" directory="[CFINSTALL]/verity/collections" name="GetCols">
<cfdump var="#GetCols#">


2. Go to:
[CFINSTALL]/verity/Data/services/ColdFusionK2_indexserver1/ws

(The "ws" directory acts as a work space during collection creation)

3. Run: [rm –rf *] to remove everything in the ws directory.

4. Run: [CFINSTALL]/bin/cfmxsearch restart

5. Re-create the collection in the CFADMIN or using CFCOLLECTION.