Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I set the criteria in CFsearch tag?

Status
Not open for further replies.

newbiepg

Programmer
Nov 6, 2002
181
IN
I have created a search page using verity, I am having a hard time trying to put a condition.

I am showing the code below, when I enter some criteria in the form below, it is not getting searched.

Secondly I am confused as to whether we have to update the index as shown below every time we query , this is slowing down the results




<cfquery name=&quot;List&quot; datasource=&quot;test&quot;>
select distinct iID,sRoguePassword from myusers
</cfquery>


<!---
<CFINDEX COLLECTION=&quot;test&quot;
ACTION=&quot;Update&quot;
TYPE=&quot;Custom&quot;

KEY=&quot;iID&quot;
BODY=&quot;sRoguePassword&quot;
QUERY=&quot;List&quot;
RECURSE=&quot;Yes&quot;
EXTERNAL=&quot;Yes&quot;
LANGUAGE=&quot;English&quot;
>--->

<h2>Indexing Complete</h2>



<cfif isdefined(&quot;Form.FindMe&quot;) AND (Form.FindMe is not &quot;&quot;)>

<CFSEARCH
NAME=&quot;testSearch&quot;
COLLECTION=&quot;Message&quot;
TYPE=&quot;Simple&quot;
CRITERIA=&quot;#Form.FindMe#&quot;>

<!---Available Match Information--->
<cfoutput query=&quot;testSearch&quot;>
Records Searched:#RECORDSSEARCHED#<br>
Returned:#RECORDCOUNT#<br>
URL #URL# <br>
KEY #KEY# <br>
row #CURRENTROW# <br>
Title#TITLE# <br>
Score#SCORE# <br>
Summary #SUMMARY#<br>
</cfoutput>
<hr>

</cfif>

<form action=&quot;veritytest2.cfm&quot; method=&quot;post&quot;>
Search this site for:
<input type=&quot;text&quot; name=&quot;FindMe&quot;>
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;GO&quot;>
</form>
 
Hi Newbiepg,

The only time you have to run CFINDEX is if the data changes.

Are you searching for the password, or the user ID? If you want either, you need to change the body attribute to
&quot;iID,sRoguePassword &quot; so that both fields will be indexed for search.

HTH,




Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top