Creating a Verity collection from a database table?
Posted on 2004-10-13
I've been working on a document management project for a few months and have almost completed it. I am at the stage where I need to create a search interface for my documents and have successfully done so using Verity. I created a collection and then indexed it using the "Path" attribute. This works well but I did run into some problems because I store information about the documents in a database and couldn't relate this information to the output of the Verity search results. I read up on this and found an example in the CFDOCS online. I'm not sure if I am understanding this right but it looks like I may be able to create a collection using my database table and also add a few custom fields in that I could use in my search as well.
Here's my question: Is it even possible to populate a collection using my database that would actually index the files on the server? I need the search to look into the files content and not just the data I have saved in the database.
Can I add custom1 and custom2 attributes to the collection and will those be searchable and returned in the output?
Here's what I have:
A table named Documents that has a DocumentID, Description, Filename, Full_Path, FolderID
I think I could do a query to get all of the documents in the database and then output that around a cfindex but I tried that and it froze up my laptop. I don't know if this will actually create a good index either. The reason I want to do this is so that I can allow the filename and description that I have saved in the database to be searched and found along with the actual contents of the document. Otherwise I have to create two seperate collections, one for the content and one for the database data.
Here's the code I tried if this makes sense:
<cfquery name="getDocs" datasource="#application.datasource#">
FROM DOC D
<p>#docname# #doctitle# #fullpath# #filename#p>
I'm not sure if I should try to make the key equal the primary key of the database table or the full path to the document?
Thanks for any advice on this one!