Subject: RE: db.search works fine on Client R5 but not on R6 (it retrieves old values)
Sounds like the full-text index is out of date. It might be permanently out of date because it’s from an earlier version of the database incompatible with the current full-text indexing format.Try deleting and recreating the index.
Subject: RE: db.search works fine on Client R5 but not on R6 (it retrieves old values)
Sorry, read too fast. The problem is probably due to your using a NotesDocument object and then not using Delete to remove it from memory cache when you’re done with it. Next time you use the same document in the back end, it gives you the old cached value.
Subject: RE: db.search works fine on Client R5 but not on R6 (it retrieves old values)
No, when I said you have to use Delete, I actually meant you have to use Delete, as in:
Set docCur = coll.GetFirstDocument
Do Until docCur Is Nothing
Set docNext = coll.GetNextDocument(docCur)
' INSERT CODE HERE TO PROCESS A SINGLE DOCUMENT
Delete docCur ' so documents don't accumulate in cache
Set docCur = docNext
Subject: RE: db.search works fine on Client R5 but not on R6 (it retrieves old values)
What I don’t understand (and maybe I’m being stupid here) is why deleting docCur helps with the cache and memory in the loop… but don’t you keep caching the documents on docNext each time you replace it with a new value? Why aren’t you trading the caching of one doc object for another?
If you could test for docNext being nothing and delete it at the very end of each loop cycle, perhaps… but this will slow things down and take away from any advantage to the garbage collection, no?
Subject: RE: db.search works fine on Client R5 but not on R6 (it retrieves old values)
tx for the clue.
To have a good results, I have to write the code like this (it’s strange). I have to loop the collection twice :
Set coll = db.search (formula$, Nothing, 0)
Set doc = coll.getFirstDocument()
While Not (doc Is Nothing)
Set docNext = coll.GetNextDocument(doc)
Delete doc ' so documents don't accumulate in cache
Set doc = docNext
Wend
Delete coll
Set coll = Nothing
Set coll = db.search (formula$, sDate, 0)
Subject: RE: db.search works fine on Client R5 but not on R6 (it retrieves old values)
This is because those documents are being left in the cache by some other script that’s failing to clean up after itself. Or maybe, depending what you edited and ran when, they were left over from the last time this script ran. In any case, if you can’t find the script that’s causing the problem and you want to fix this one without having to do two searches (very wasteful), you could store the note ID of a document in a string variable, “delete” the document, then use GetDocumentByID to fetch it again – then when you’re done with it, “delete” that also, of course.