views:

54

answers:

1

I have a collection of files which have been added to a verity collection. The filename, with complete path, has been used as the key.

I would like to move the location of the files on disk, but I am concerned that I will end up with duplicate entries (when I update the same file, the path to the file will be different, so I'll have an entry for the old file and an entry for the new one).

I wasn't involved with the original application setup, and I don't know much about verity or coldfusion (the rest of the app is in PHP). Can anyone suggest how I can go about running some sort of regex replace on each key in a verity collection, or possibly suggest another approach?

+3  A: 

I would recommend to create new collection, adjust to your new specs (at least new path in your case) and swich to it in the application code (replace the collection name in cfindex/cfsearch).

After making sure it works properly you are free to delete the old one.

If you can not create collection for some reason, you can simply purge the collection, switch the path and re-index it.

Please note that you can do all of this directly from the application (maybe temporarily script) using cfcollection tag, and using CF Admin (see Verity Collections in menu) too.

Sergii
Purging and reindexing is an option I have considered, but the process of reindexing thousands of documents is time consuming (we have pptx/docx/xls documents in there, which verity doesn't support, so they are converted to PDF beforehand as well). I have rebuilt one of the indexes one time and it took several days.I can do this as a last resort, but what I would really love is something that would just update all of the keys, e.g. in SQL something like 'update collection set id = replace(id, 'oldlocation', 'newlocation')' - this would avoid reindexing.
El Yobo
Well, this is really important clarification about collection size -- you should have mentioned it in your question. Sorry, but my knowledge does not give ways to achieve this, even using tricky ways like direct access to the VerityService *verityService = CreateObject("java","coldfusion.server.ServiceFactory").getVerityService()* -- this onject shows nothing that can help.
Sergii
Thanks for your help :) In the meantime I will just leave things as they are; mid term we're looking to migrate to Solr anyway, which will require reindexing, so I'll worry about it then.
El Yobo
Further to my last comment, the Solr implementation has gone well - overall Solr blows Verity out of the water. Vastly more flexible, much faster queries and much faster indexing.
El Yobo