User Guide
164 Developing Web Applications with ColdFusion
<!--- Run the LDAP query --->
<CFLDAP NAME="OrgList"
SERVER="myserver"
ACTION="query"
ATTRIBUTES="o, telephonenumber, dn, mail"
SCOPE="onelevel"
FILTER="(|(O=a*) (O=b*))"
SORT="o"
START="c=US">
<!--- Output query result set --->
<CFOUTPUT QUERY="OrgList">
DN: #dn# <BR>
O: #o# <BR>
TELEPHONENUMBER: #telephonenumber# <BR>
MAIL: #mail# <BR>
=============================<BR>
</CFOUTPUT>
<!--- Index the result set --->
<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
MessageNumber is reset as messages are added and deleted. To avoid mismatches
between the unique MessageNumber identifiers on the server and in the Verity
collection, it’s a good idea to 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.