Db.FTsearch Query not understandable - seems to be trimming the search query

Our clients are Notes 8.5.3 FP3 on either Windows XP or Windows 7,the server is still 8.5.1.

We need to search across multiple databases with very long complex queries. The query syntax is correct, we develop it using Full text Search and also manually run using the IONET search. The problem is that we need to run the searches overnight and store the results for use next next. So wrote some code that runs the search using Notesdatabase.FTSearch and it appears that the supplied query string is being truncated, that then leads to ‘query not understandable’ .

So has anyone else had this? Any ideas how to get around it?

(And no we dont have the option of telling the users to have simpler queries!)

Example query that works:[BHSE_Code] CONTAINS (65/02) AND [ModelName] CONTAINS (“ADHESIVE TAPE”) AND (([_CreationDate] >=13/07/2013) AND ([_CreationDate] <=11/09/2013)) and [form] contains (report)

and one that doesn’t: [BHSE_Code] CONTAINS (10/01) AND [RepCauseEffectLevel2] CONTAINS (“Material [2000]”) AND [ModelName] CONTAINS ("Castor ") AND NOT [Action] CONTAINS (echo) AND (([_CreationDate] >=01/09/2013 00:00:00) AND ([_CreationDate] <=Today)) and [form] contains (report)

Thanks

Sue

Subject: SOLVED & Solution

This turned out to be nothing at all to do with the query being trimmed. Oh no it was much more simple than that.

Most of the searches were of the ‘tell me everything reported for X in the last month’. When the search is initially set up on a Notes document the ‘date from’ is of the form 1/10/13. When our agent that resets the start of the month runs (changes 1/9/13 to 1/10/13 etc) it changes the format of the stored date from 1/10/13 to 1/10/13 00:00:00. And its the time part that the FTSearch doesn’t like.

So moral = when using the Notesdatabase.FTSearch ensure all dates do NOT have the time part specified.

Subject: .

The following part of the query looks strange:NOT [Action] CONTAINS (echo)

If “echo” is a text string, I would put quotres around it.

If you run this as db.FTSearch, you could run multiple searches, first one that return a larger set of documents, then you search the document collection or loop though it. Depends on teh number of documents, though.