Creates and administers Verity search engine collections.
<cfcollection
action = "action"
collection = "collection_name"
path = "path_to_verity_collection"
language = "language"
name = "queryname"
categories = "yes" or "no">
cfexecute
,
cfindex
,
cfobject
,
cfreport
,
cfsearch
,
cfwddx
ColdFusion MX 7:
map
and repair
options of the action
attribute. They might not work, and might cause an error, in later releases.
categories
attribute and categorylist
action.
list
action.
list
action.
ColdFusion MX:
action
attribute: it is now required.
action
attribute list
value. It is the default.
action
attribute value map
: it is not necessary to specify the action
attribute value map
. (ColdFusion detects collections and creates maps collections as required.)
Attribute | Req/Opt | Default | Description |
---|---|---|---|
action |
Required; see Usage |
list |
|
collection |
See Usage |
|
|
path |
See Usage |
|
Absolute path to a Verity collection. To map an existing collection, specify a fully qualified path to the collection (not including the collection name); for example, |
language |
See Usage |
English |
Although English is the default language, Englishx, a more advanced English locale, is also provided. For a list of options, see Usage. Requires the appropriate (European or Asian) Verity Locales language pack. |
name |
See Usage |
|
Name for the query results returned by the |
categories |
See Usage |
no |
Used only for creating a collection:
|
With this tag you can create, register, and administer a Verity collection that was created by ColdFusion or by a Verity application.
The following table shows the dependence relationships among this tag's attribute values:
This attribute is required, optional, or unnecessary (blank): | For this action attribute value: | ||||||
---|---|---|---|---|---|---|---|
list
|
create
|
map
|
optimize
|
repair
|
delete
|
categorylist
|
|
|
|
Required |
Required |
Required |
Required |
Required |
Required |
|
|
Required |
Required |
|
|
|
|
|
|
Optional |
Optional |
|
|
|
|
|
Required |
|
|
|
|
|
Required |
categories |
|
|
|
|
|
|
|
The following examples illustrate the structures returned by the categorylist
action:
CATEGORIES | |
---|---|
blue |
10 |
green |
3 |
magenta |
3 |
purple |
2 |
CATEGORYTREES | |
a/ |
10 |
a/b |
10 |
a/b/c |
10 |
a/b/c/subdir |
3 |
The list
action returns the following information in a result set that contains one row per collection:
Column | Contents |
---|---|
CATEGORIES |
|
CHARSET |
The character set of the collection. |
CREATED |
The date and time that the collection was created. |
DOCCOUNT |
The number of documents in this collection. |
EXTERNAL |
|
LANGUAGE |
The locale setting of the collection. This information is not available for K2Server collections. |
LASTMODIFIED |
The date and time that the collection was last changed. |
MAPPED |
Obsolete |
NAME |
The name of the collection. |
ONLINE |
Obsolete |
PATH |
Absolute path to the collection. |
REGISTERED |
Obsolete |
SIZE |
The size of the collection, expressed in kilobytes. |
The ColdFusion MX Administrator Verity > Collections page displays the information that is returned when you use the list
attribute.
If the Verity Server is not running when the list
action is executed, the tag throws an error.
To determine whether a collection exists, use code, such as the following, to execute a query of queries:
<cfcollection action="list" name="myCollections" > <cfquery name="qoq" dbtype="query">
select * from myCollections
where myCollections.name = 'myCollectionName'
</cfquery> <cfif qoq.recordcount GT 0> <!--- Collection exists ---> <cfdump var = #qoq#> </cfif>
To get a result set with values for all the collections that are registered with the Verity server, use code such as the following:
<cfcollection action="list" name="myCollections"> <cfoutput query="myCollections"> #name#<br> </cfoutput>
To add content to a collection, use cfindex
. To search a collection, use cfsearch
.
The language
attribute of this tag supports the following options:
Asian Language Pack |
|||
Japanese |
Korean |
Chinese |
Traditional Chinese |
Multilanguage Language Pack |
|||
Unicode |
|
|
|
Western European Language Pack |
|||
Bokmal |
Finnish |
Italian |
Spanish |
Danish |
French |
Nynorsk |
Swedish |
Dutch |
German |
Portuguese |
|
Eastern European/Middle Eastern Language Pack |
|||
Arabic |
Greek |
Polish |
Turkish |
Bulgarian |
Hebrew |
Russian |
|
Czech |
Hungarian |
Russian2 |
|
The default location of Verity collections is as follows:
<!------------------------------------------------------------------------- (coll_actn.cfm) Check for server platform and use its default Verity Collection directory. If you did not install ColdFusion MX in the default directory, or if you use the J2EE configuration, or if your webroot is not C:\CFusionMX7\wwwroot, you might need to change the path in this example. For example, for JRun4 the path might be C:\JRun4\Verity\Collections\ ---------------------------------------------------------------------------> <cfif Find("Windows", Server.OS.Name)> <cfset collPath = "C:\JRun4\Verity\Collections\"> <cfelse> <cfset collpath = "/opt/coldfusionmx7/verity/collections/"> </cfif> <!-------------------------------------------------------------------------- Process form input and do the requested cfcollection operation. ---------------------------------------------------------------------------> <cfif IsDefined("form.CollectionName") AND IsDefined("form.CollectionAction")> <cfif form.CollectionName is not ""> <cfswitch expression="#FORM.CollectionAction#"> <cfcase value="Create"> <cfcollection action="CREATE" collection="#FORM.CollectionName#" path="#collPath#" categories="yes"> <h3>Collection created.<br> Use CFINDEX to populate it.</h3> </cfcase> <cfcase value="Repair"> <cfcollection action="REPAIR" collection="#FORM.CollectionName#"> <h3>Collection repaired.</h3> </cfcase> <cfcase value="Optimize"> <cfcollection action="OPTIMIZE" collection="#FORM.CollectionName#"> <h3>Collection optimized.</h3> </cfcase> <cfcase value="Delete"> <cfcollection action="DELETE" collection="#FORM.CollectionName#"> <h3>Collection deleted.</h3> </cfcase> </cfswitch> <cfelse> <h3>Please enter a name for your collection</h3> </cfif> </cfif> <!-------------------------------------------------------------------- (coll_form.cfm) Form to specify the collection name and action coll_form.cfm ---------------------------------------------------------------------> <form action="coll_actn.cfm" method="POST" > <select name="CollectionAction"> <option value="Create">Create this collection <option value="Optimize">Optimize this collection <option value="Repair">Repair this collection <option value="Delete">Delete this collection </select> <p><strong>Collection on which to act</strong><br> Use the default value or enter your own Collection name<br> <input type="Text" name="CollectionName" value="My_coll"></p> <input type="Submit" name="" value="alter or create my collection"> </form>