User Guide

284 Chapter 15 Indexing and Searching Data
<cfindex action="update"
collection="ldap_query"
key="dn"
type="custom"
title="o"
query="OrgList"
body="telephonenumber">
<!--- Search the collection --->
<!--- Use the wildcard * to contain the search string --->
<cfsearch collection="ldap_query"
name="s_ldap"
criteria="*617*">
<!--- Output returned records --->
<cfoutput query="s_ldap">
#Key#, #Title#, #Body# <br>
</cfoutput>
Indexing cfpop query results
The contents of mail servers are generally quite volatile; specifically, the message
number is reset as messages are added and deleted. To avoid mismatches between
the unique message number identifiers on the server and in the Verity collection,
you should re-index the collection before processing a search.
As with the other query types, you need to provide a unique value for the key
attribute and enter the data fields to index in the
body attribute.
The following example updates the pop_query collection with the current mail for
user1 and searches and returns the message number and subject line for all
messages containing the word action:
<!--- Run POP query --->
<cfpop action="getall"
name="p_messages"
server="mail.company.com"
userName="user1"
password="user1">
<!--- Output POP query result set --->
<cfoutput query="p_messages">
#messagenumber# <br>
#from# <br>
#to# <br>
#subject# <br>
#body# <br>
<hr>
</cfoutput>
<!--- Index result set --->
<cfindex action="update"
collection="pop_query"
key="messagenumber"