According to the SOQL and SOSL Reference page on
SearchQuerystring is longer than 10,000 characters, no result rows are returned. If
SearchQueryis longer than 4,000 characters, any logical operators are removed. For example, the
ANDoperator in a statement with a SearchQuery that’s 4,001 characters will default to the
ORoperator, which could return more results than expected.
This doesn't make sense - "any logical operators are removed" doesn't really mean the same thing as "the AND operator... will default to the OR operator."
I tried running some
OR queries without the
OR keyword - using spaces or commas in place of
OR, to try to mimic the "logical operators are removed" statement, but it didn't return any results, while the original OR query. Does it really jusy mean that AND will be treated as OR? What if my query is > 4000 characters (and less than the upper limit of 10,000 characters), but includes only search terms separated by
OR? Will it work as written? Not sure it matters, but assume my
SearchQuery will be a bound Apex variable.