Hi everyone first time poster here.I have a scrip that searches my db for documents that have a field (RequestStatus) that contains “Draft”.
I am searching my db using this method.
SearchString = |FIELD RequestStatus CONTAINS Draft|
Set Coll = Db.FTSearch(SearchString,0)
The collection should hold 3 documents that have a status of Draft but it only holds one. I checked using the debugger. Then when I try to get the first document it doesn’t work
Set TempDoc = Coll.GetFirstDocument
In the debugger TempDoc is False.
Subsequently when I try to get information from the document such as who to send an email to I get an error.
Subject: FTSearch Problem
I dont have access to the help right now (it Search and FTSearch is explained there - check it out for details).
Take care not to mix up FTSearch and Search. Try enclosing the field name in [brackets] and skip the FIELD keyword. Try using Search and the search string {RequestStatus *= “Draft”}. Verify uppercase/lowercase. Explicitly set the FTSearch options before searching. Make sure the db is full text indexed. Print out coll.count to get the number of documents found (if coll is nothing then print 0 else print coll.count)
Read the help - search is explained quite well there. It is a little confusing at first (because of all the different possibilities and options) but it is well worth your time.