i have been facing this problem of interpreting the CF documents for quite a while with regards to implementing search.
I want to search the database to to make a query collection and then provide a link to the file to run the actual query for the identified id no for the document / record searched, as the records are stored in the DBMS.
However when I use the sample code, and make a Verity search program as guided in the docs, I always end up in the URL : http://localhost/verity (this is the URL from where I am running the sample code).
Instead of the above link what I want is a URL like - http://localhost/verity/content.cfm?cnt_id=562
where 562 is the document ID in the database table and the content.cfm is the file that receives the ID from the refering URL to process the query to fetch the said record.
Pls. help
<html>
<head>
<title>Creating Index</title>
</head>
<body>
<h2>Indexing Complete</h2>
<!--- Select the entire table --->
<cfquery name="cnt_search"
datasource="#dsn#">
SELECT *
FROM temp_content
</cfquery>
<!--- Output the result set --->
<cfoutput query="cnt_search">
#tc_id#, #tc_pl_holder2#
</cfoutput>
<!--- Index the result set --->
<cfindex collection="dbsearch"
action="Update"
type="Custom"
body="tc_pl_holder2"
key="tc_id"
title="Content"
query="cnt_search">
<cfoutput>
The collection "dbsearch" has been indexed.
</cfoutput>
</body>
</html>
<!--------------------------------------------- index_collection.cfm over--------------------------->
<html>
<head>
<title>Search output page</title>
</head>
<body>
<cfsearch name="Search1"
collection="#form.collection#"
form type="#form.type#"
criteria="#form.searchstring#">
<h2>Search Results</h2>
<cfoutput>
#Search1.RecordCount# found out of
#Search1.RecordsSearched# searched.
</cfoutput>
<hr noshade>
<cfoutput query="Search1">
<a href="#Search1.URL#">#Search1.title#</a><br> <!--- I want this output changed---->
#Search1.key#<br>
</cfoutput>
<hr noshade>
</body>
</html>
<!--------------------------------------------- search_result_collection.cfm over--------------------------->
Amit Bhargava
Webportia Technologies (for custom CF-CMS solutions)
<cfindex action="UPDATE" collection="MyDBCollection" Key="SearchID" type="CUSTOM" title="ItemName" query="ItemQuery" body="ItemDescr,Stuff1" custom1="SearchURL" custom2="ArticleID">
Dennis Spaag
Gorilla Polymedia, Inc.
www.gorillapolymedia.com