I have spent the last two days getting a verity search working and thought I
would share the knowledge I have gained.
1) When searching everything but the CF_BODY, you must use the syntax
(CF_whatever <verity statement> keyword1 AND keyword2)
2) When searching CF_BODY, simply use keyword1 keyword2. Using the syntax in
#1 produces 0 results.
3) When combining searches on multiple fields (CF_TITLE, CF_KEY, CF_BODY) you
must put each piece of the search in () and use AND, OR, etc in between.
Here is what I did to do a three field search over CF_CUSTOM1, CF_TITLE,
CF_BODY. If anyone has a cleaner way of doing this I would appreciate the
input.
<!--- Set all of the possible options for the Verity search --->
<CFIF Len(Attributes.title)>
<CFSET titleCriteria = "(CF_Title <contains> #Replace(Trim(Attributes.title),
" ", " AND ", "ALL")#)">
<CFELSE>
<CFSET titleCriteria = "">
</CFIF>
<CFIF Len(Attributes.author)>
<CFSET authorCriteria = "(CF_Custom1 <contains>
#Replace(Trim(Attributes.author), " ", " AND ", "ALL")#)">
<CFELSE>
<CFSET authorCriteria = "">
</CFIF>
<CFIF Len(Attributes.keywords)>
<CFSET keywordsCriteria = "(#Replace(Trim(Attributes.keywords), " ", " AND ",
"ALL")#)">
<CFELSE>
<CFSET keywordsCriteria = "">
</CFIF>
<CFIF Len(Attributes.title) AND (Len(Attributes.author) OR
Len(Attributes.keywords))>
<CFSET and1 = " AND ">
<CFELSE>
<CFSET and1 = "">
</CFIF>
<CFIF Len(Attributes.author) AND Len(Attributes.keywords)>
<CFSET and2 = " AND ">
<CFELSE>
<CFSET and2 = "">
</CFIF>
<!--- Now cram everything into something CF and Verity understand --->
<CFSET criteria = titlecriteria&and1&authorCriteria&and2&keywordsCriteria>
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at
http://webmail.netscape.com.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.