cf search using verity for my web site. I actually took the code from docs on teh web and tweeked a couple things out on it. Now it is throwing errors and I can't figure out why. What is funny is what is throwing errors was taken strait from the adobe web site docs., so here is my code, I will show you the code I use to index the verity collection, and then the result page.
Indexing code:
[CODE=cfm]<cfflush>
<cfquery name="getresult s" dataSource="#AP PLICATION.dataS ource#">
SELECT Content.Body, Content.title, Content.page, Content.Content ID
FROM Content
</cfquery>
<span class="style1"> Indexing data ...</span><br>
<cfflush>
<cfindex action="refresh "
collection="pds Site"
key="ContentID"
type="custom"
title="title"
query="getresul ts"
body="title,Bod y,page">
Result page:
<cfsearch name="GetResult s"
collection="pds Site"
criteria="#FORM .criteria#">
<head>
</head>
<body>
<cfform action="result. cfm" method="post">
<cfinput type="text" name="criteria" value="#FORM.cr iteria#" message="Please enter your key word to search." validateat="onS ubmit" validate="nobla nks" required="yes" id="criteria" size="30" class="main_Inp uts">
<cfinput type="submit" value="Search">
</cfform>
<cfoutput>
Search Results:#FORM.c riteria#
</cfoutput>
<cfif GetResults.Reco rdCount is 0>
No files found for specified search, please try a new search.
<cfelse>
<cfoutput query="GetResul ts">
<cfset bgcolor=IIf(Cur rentRow Mod 2,
DE('ffffff'),
DE('ffffcf'))>
#CurrentRow#
<cfset FileName=GetFil eFromPath(Key)>
<cfset Ext=ListLast(Fi leName, ".")>
<cfif Trim(Title) IS "">
<cfset display=GetFile FromPath(Key)>
<cfelse>
<cfset display=title>
</cfif>
<a href="#page#" class="subNav"> #display#</a> <span class="style8"> (#score#)</span> <br>
<span class="style8"> <small>#body# </small></span>
</cfoutput>
</cfif>
[/CODE]
Now here is the first error. (there are a couple, but lets do them one at a time.)
Error message:
Attribute validation error for tag CFINPUT.
The tag requires the attribute(s): NAME.
The error occurred in C:\Websites\res ult.cfm: line 81
I do this kind of stuff all the tie with form fields, and now anything I do to fix it, it throws this error. What am I doing wrong here to place what you used for search critera on a search box in some other place on the site into this search box?
Error 2:
Then my next error is that page is not defined, that is where my link is set up for you to click on the record that gave you results. I can get that error after I fix the search critera error
Indexing code:
[CODE=cfm]<cfflush>
<cfquery name="getresult s" dataSource="#AP PLICATION.dataS ource#">
SELECT Content.Body, Content.title, Content.page, Content.Content ID
FROM Content
</cfquery>
<span class="style1"> Indexing data ...</span><br>
<cfflush>
<cfindex action="refresh "
collection="pds Site"
key="ContentID"
type="custom"
title="title"
query="getresul ts"
body="title,Bod y,page">
Result page:
<cfsearch name="GetResult s"
collection="pds Site"
criteria="#FORM .criteria#">
<head>
</head>
<body>
<cfform action="result. cfm" method="post">
<cfinput type="text" name="criteria" value="#FORM.cr iteria#" message="Please enter your key word to search." validateat="onS ubmit" validate="nobla nks" required="yes" id="criteria" size="30" class="main_Inp uts">
<cfinput type="submit" value="Search">
</cfform>
<cfoutput>
Search Results:#FORM.c riteria#
</cfoutput>
<cfif GetResults.Reco rdCount is 0>
No files found for specified search, please try a new search.
<cfelse>
<cfoutput query="GetResul ts">
<cfset bgcolor=IIf(Cur rentRow Mod 2,
DE('ffffff'),
DE('ffffcf'))>
#CurrentRow#
<cfset FileName=GetFil eFromPath(Key)>
<cfset Ext=ListLast(Fi leName, ".")>
<cfif Trim(Title) IS "">
<cfset display=GetFile FromPath(Key)>
<cfelse>
<cfset display=title>
</cfif>
<a href="#page#" class="subNav"> #display#</a> <span class="style8"> (#score#)</span> <br>
<span class="style8"> <small>#body# </small></span>
</cfoutput>
</cfif>
[/CODE]
Now here is the first error. (there are a couple, but lets do them one at a time.)
Error message:
Attribute validation error for tag CFINPUT.
The tag requires the attribute(s): NAME.
The error occurred in C:\Websites\res ult.cfm: line 81
Code:
79 : <td class="style8">Search:</td> 80 : <td><cfinput type="text" name="criteria" value="#FORM.criteria#" message="Please enter your key word to search." validateat="onSubmit" validate="noblanks" required="yes" id="criteria" size="30" class="main_Inputs"></td> 81 : <td><cfinput type="submit" value="Search"></td> 82 : </tr> 83 : </table>
Error 2:
Then my next error is that page is not defined, that is where my link is set up for you to click on the record that gave you results. I can get that error after I fix the search critera error
Comment