FTSEARCH with dates problem

Hi,

i’m trying to use the FTSearch function with dates but i’ve got some problems.

I want to get all the documents of a View wich are modified after a certain date that i determine.

For exemple:

Set notesView = db.GetView(“$Calendar”)

search$ = |@Modified > @TextToTime(date)|

(date = a certain date that i choose.)

Note that this type of search works fine with the db.Search function, but with this FTSearch the error ‘Query is not undersandable’ rise.

How can i do that ?

Thx for the help.

Subject: FTSEARCH with dates problem

It seems to me that You actually don’t want to do a FULL-TEXT search…

Simply change the search string to include the selection that You are using in the view; for instance:

strSearch = |Form=“MyForm” & Status=“OK” & @Modified > @TextToTime(date)|

and do a normal db.Search().

Subject: RE: FTSEARCH with dates problem

yes but i just want to retrieve records from a certain View. Calendar for example.If i use the dbSearch, he will retrieve all the matching records not depending on the view.

Subject: RE: FTSEARCH with dates problem

That is exactly why You should include the view’s selection formula in Your search string. This will do exactly the same selection as the view.

Subject: RE: FTSEARCH with dates problem

Muller, your instincts are correct. It is generally more efficient to use FTSearch on a view, rather than search the entire database with a formula, assuming the database is full-text indexed.

The query string for FTSearch is not a macro formula, however. This method uses the same syntax as searches in the “search this view” field:

This query syntax is documented in the client help file, in a document entitled, “Refining a search query using operators”. In your case, you probably want to do something like:

collection = view.FTSearch({ [_RevisionDate] >= } & selectedDate, 0)

where selectedDate is a variable in your code.

Note: For your particular search, where you want documents modified since a certain date, the NotesDatabase.Search method is actually not a bad choice if the view contains most of the documents in the database or if the number of matching documents is likely to be small. That’s because the Search method has a second argument that lets you specify a date/time where you only want documents created or modified since that time, and this is pretty efficient because it uses an internal table of all notes sorted by when modified.

Subject: RE: FTSEARCH with dates problem

thx a lot for the infos it helped me a lot.Ciao.