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!

What is Verity & how do I use it?

Verity

What is Verity & how do I use it?

by  RichardBro  Posted    (Edited  )
Verity is a very powerful 'full text' search tool, which can handle and index a wide variety of file formats.

The version that ships with CF is a slightly limited in that it only has provision for only two structured fields (Custom 1 & 2).

CF accesses verity through the following tags :
CFCollection
CFIndex
CFSearch

CFCollection provides the maintainence functionality
CFIndex provides the mechanism to add/modify/delete entries
CFSearch provides a way of getting the documents back

How to set up a collection.

Creating a collection can be done either throught the Verity option in the CF Administrator or by using CFCollection with a 'create' action.

eg. <CFCOLLECTION action="CREATE" collection="CollectionName" path="Collection Path">

Note Path is only needed if you want to create a collection in a new location.

Verity requires unique collection names, even if the collectionas are in seperate folders.


Adding Some Content

Additions can be done either en masse or individually, both routes use the CFIndex tag.

eg.

for a single file:

<CFINDEX action="UPDATE" collection="Collection Name" key="Filename" type="FILE" custom1="Structured Field #1" custom2="Structured Field #1" urlpath="URL of file path" language="English">

For an entire folder:

<CFSET IndexCollection = "vtest">
<CFSET IndexDirectory = "e:\webdev\agendademotest\documents\">
<CFSET IndexRecurse = "YES">
<CFSET IndexExtensions = ".doc, .htm, .html, .txt, .xls">
<CFSET IndexLanguage = "english">

<CFINDEX
collection="#IndexCollection#"
action="REFRESH"
type="PATH"
key="#IndexDirectory#"
extensions="#IndexExtensions#"
recurse="#IndexRecurse#"
language="#IndexLanguage#"
urlPath="151.176.178.172/agendademotest/documents/">

When you index a path, you can specify the file types to be indexed (obviously not needed when you do a single file.)

[Red]!!!! VERY IMPORTANT !!!!![/Red]

Once a file is indexed, it MUST NOT be moved or renamed, if it is, verity will still find the index entries, but you won't be able to retreive the file.


Getting files back

This uses the CFSearch tag:

eg.

<CFSET SearchDirectory = "e:\webdev\menu\agendademotest\documents">
<CFSET SearchCollection = "membersagendatest">

<CFSEARCH
name = "GetResults"
collection = "#SearchCollection#"
criteria = "#Form.Criteria#">

This return a query with the following contents

Score - a numeric value (0 to 1)that represents the relavence of the record (multiply by 100 to give a %).
Title - The title of the Document (file) eg the title that is set as a property in word.
Summary - an abstract of the document (the first paragraph or upto the first 500 characters).
Key - the name and location of the file (url)
Custom1 - User defined content that was added during the CFIndex routine
Custom2 - User defined content that was added during the CFIndex routine

All of the above are accessable as variables from a normal CFQuery
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top