In LotusScript, does anyone know the maximum length of a Query String that the FTSearch( Qry$, 0 ) can handle?

StackOverflow https://stackoverflow.com/questions/19546847

Question

Using LN 8.5.3 FP3, I am programmatically constructing a Query to pass to the FTSearch(Qry$, 0 ) function in LotusScript. Can anyone tell me what the maximum length the string can be before the Query cannot be executed?

The code is being run by a scheduled agent on a Notes 8.5.3 FP3 Server and htto url size is not applicable to the situation.

Anticipating your feedback and experiences..

Leon

Was it helpful?

Solution

as far as I see limit for 1 field/value is up to 128 characters, however as Michael noticed (in comments below) there could be many fields, very possibly with total size up to 16Kb.

you easy can do test yourself:

Dim session As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim Query As String
Dim i As integer

Set db = session.Currentdatabase

For i = 1 To 32000
    Print i
    Query = Query & "1"
    Set col = db.Ftsearch({"} & Query & {"}, 0)
Next

OTHER TIPS

In Lotusscript you can use a document collection and narrow it down with sequential smaller FTSearches. That way you might prevent the risk of getting a query that is too large.

I assume your query is more complex than just searching for a single string, read it may consist of multiple queryparametesr like [Form]="Memo" & [Subject]="Test" and so on. While the single search String (i.e. "Test") might be limited by 128 characters, the entire query is by far not limited to 128 Chars. We have created and used dynamic query that are much longer than that. I have seen queries exceeting 1024 Bytes and more and these were working. My guess is a limit of about 16kB for the entire query.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top