How to you resolve (BTSB0) - bts clucene error: Too Many Clauses
(BTSB0) - bts clucene error: Too Many Clauses
When Clucene rewrites a search expression with, by default, more than 1024 clauses, this error is generated.
Clucene has this limit because, as we see with s*, some wildcard expansions can be very large and this can use a lot of virtual memory. Clucene has a parameter to limit and help control memory usage. The good news is that it is tunable and an index basis. In BTS, if you have indexes that you want to allow very large query rewrites, then you can specify the max_clause_count parameter. For my test index, if I want to search on the wildcard search s*, then I need to create the index with a max_clause_count larger that 32798.
create index bts_idx on bts_tab (text bts_char_ops) using bts (max_clause_count="4000"); in sbspace1;
Keep in mind that these queries can result in more memory usage and you may see the server allocation more virtual segments. The number of virtual segments attached can be monitored with onstat -g seg. (BTSB0) - bts clucene error: Too Many Clauses