What IS the limit for the ftsearch query string?

Anyone have a definitive answer for what the max query can be for the ftsearch method?

Any tips for shortening the string?

Any tips for what to do then the string is > 250?

…when the results are over 5000?

Many thanks.

Subject: RE: What IS the limit for the ftsearch query string?

There are two maximums here; one is for the length of the entire query string (at least 1000, possibly much more), and one is for the length of a string literal within the query string (in the neighborhood of 250). I don’t know offhand exactly what either is.

If you need a string literal within the query that exceeds 250 chars, you can divide it into two strings wherever it has a space, e.g.:

“You could tell that he was dying by the color of his eyes” & “and the way he stomped his feet, with a thud”

To make the complete expression shorter, use [fieldname] instead of FIELD fieldname, | and & instead of or and and (though these don’t always work the same).

Subject: RE: What IS the limit for the ftsearch query string?

Thanks for the quick response!

So this query is 452 characters

[SendTo] CONTAINS “CN=Stefanie Sullivan/O=Domain”

OR [SendTo] CONTAINS “ssullivan@domain.com”

OR [SendTo] CONTAINS “Stefanie Sullivan”

OR [CopyTo] CONTAINS “CN=Stefanie Sullivan/O=Domain”

OR [CopyTo] CONTAINS “ssullivan@domain.com”

OR [CopyTo] CONTAINS “Stefanie Sullivan”

OR [BlindCopyTo] CONTAINS “CN=Stefanie Sullivan/O=Domain”

OR [BlindCopyTo] CONTAINS “ssullivan@domain.com”

OR [BlindCopyTo] CONTAINS “Stefanie Sullivan”

This is only for one person and not including the from/smtporiginator fields.

-They want to check specific fields.

-Also I’m looking up all the groups and subgroups these people are members of so, as you can see, this will get very hairy.

-They want to copy these results to another db/folder for further review.

I once tried to get a hold of the docs via a DomainSearch doc - grabbing the noteID and building the collection that way but it kept crashing my machine and time constraints did not allow me to revisit that method.

Any suggestions for a more efficient process?

Should I just loop the ftsearches for each field (And delete duplicates later)?

Subject: RE: What IS the limit for the ftsearch query string?

452 characters is not too much. You could make it shorter by using = rather than contains, and definitely leave off the “*” at the beginning of strings. I believe you should also be able to write [fieldname] = (“A” or “B” or “C”). I doubt making the query shorter will have that much effect on performance.

You definitely want to do this in one query if you can, rather than trying to combine the results of multiple queries.

I don’t know how well all that punctuation inside the search strings will work, but try it and see.

Subject: RE: What IS the limit for the ftsearch query string?

What if it was 9000 characters long?

Also I use the * because I get different (less)results if I don’t and I’m not sure why some aren’t included in the initial search.

Subject: RE: What IS the limit for the ftsearch query string?

Then do this. Do the search that returns more results and use PutAllInFolder to put them in a folder. Then do the search that returns fewer results and take them out of the folder. Look at the documents remaining in the folder and see whether they’re ones you would have wanted to find.