FTSearch
Home Up Cleaning You Inbox Error NotesUIDocument Inuse IsMailStationery FTSearch

 

Back Home

Up

ourmission
theweb.gif (1103 bytes)
booksandbibles16
thenewsroom
governmentrm.gif (1147 bytes)
searchpage
tutorials
webtools
websecurity

What is the Web?

Privacy & Disclaimer
copyrights
notices
HOME

Visitors Since
Aug - 2004

Hit Counter

 

 

FTSearch 



 

In our original search, we did a:

Then we discovered, that our stationary was getting moved and deleted as well. So, we upgraded (enhanced) our LotusScript to exclude out mailbox stationary from the collection, by doing this:

Then we did a loop searching out dates to delete documents. 

If you do not have a local copy of your mailbox, and the server or the internet is a bit slow, you will have a long wait. Especially if you have hundreds of documents to go through.

Now, we could just modify the calling routing so that instead of it sending us the preformatted query string, we simply expand it to the proper form and then call, like this.

We change contains to FIELD and stretch things out. But this makes it tough, because now our regular search will not accept the new format, and we have to diddle with our sub, and change all of the callers that we have created to clean things out.

So now we get complicatedly simple, by first doing a normal search on the DB.

In our subroutine, we add the flag to the search passed in having the @contains formula. This gives us our base NotesDocumentCollection that has our stationary excluded. Now, we do a FTSearch this time, but we only need to add our Date formula, like this.

To make it easier to follow, I set the dCollection equal to our original collection of documents, then we can simply do a FTSearch on the PostedDate field using mydate. And now we have an updated collection, that only has document before a given date in our collection (or equal to :-).

Why go through all of this trouble?

Well we can now do a collection.RemoveAllFromFolder("($Inbox)") from our inbox, to delete the documents instead or looping around and checking each and everyone. And magically, after the FTSearch , we can now do a dCollection.PutAllInFolder ("($Trash)")

Also, we can now do a CopyToDatabase to our archive our documents!

 

 

 

 

FTSearch method

Conducts a full text search of all the documents in a Notes database collection, and reduces the collection to those documents that match.

Defined in
NotesDocumentCollection

Syntax
Call notesDocumentCollection.FTSearch( query$, maxDocs% )

Parameters
query$
String. The full text query. See below for the syntax.
maxDocs% Integer. The maximum number of documents you want returned from the query. Set this parameter to 0 to receive all matching documents.

Usage
The collection of documents that match the full-text query are sorted by relevance with highest relevance first. You can access the relevance score of each document in the collection using the FTSearchScore property in NotesDocument.

If the database is not full text indexed, this method works, but less efficiently. To test for an index, use the IsFTIndexed property. To create an index on a local database, use the UpdateFTIndex method.

This method searches all of the documents in a document collection--to search all of the documents in a database, use the FTSearch method in NotesDatabase, and to search only documents found in a particular view, use the FTSearch method in NotesView.

Query syntax
The syntax rules for a search query are as follows. Use parentheses to override precedence and to group operations.
bulletPlain text--To search for a word or phrase, enter the word or phrase as is, except that search keywords and symbols must be enclosed in quotes. To be on the safe side, enclose all search text in quotes. Remember to use double-quotes if you are inside a LotusScript literal.
bulletWildcards--Use ? to match any single character in any position in a word. Use * to match zero-to-many characters in any position in a word.
bulletHyphenated words--Use hyphenated words to find two-word pairs that are hyphenated, run together as a single word, or separated with a space.
bulletLogical operators--Use logical operators to expand or restrict your search. The operators and their precedence are not (!), and (&), accrue (,), and or (|). You can use either the keyword or symbol.
bulletProximity operators--Use proximity operators to search for words that are close to each other. These operators require word, sentence, and paragraph breaks in a full-text index. The operators are near, sentence, and paragraph.
bulletField operator--Use the field operator to restrict your search to a specified field. The syntax is FIELD field-name operator, where operator is contains for text and rich text fields, and is one of the following for number and date fields: =, >, >=, <, <=.
bulletExactcase operator--Use the exactcase operator to restrict a search for the next expression to the specified case.
bulletTermweight operator--Use the termweight n operator to adjust the relevance ranking of the expression that follows, where n is 0-100.