bryan
bryan

Reputation: 9399

Cloudant full text search "too many boolean "requests"

Can anyone tell me what the limit is for boolean requests in a Cloudant full text search?

I have 206 OR's and it appears to be too much.

This is basically my query:

( this:"that" AND ping:pong AND (yes:a1 OR yes:b1 OR yes:c1 OR ...x50 ) ) OR
( this:"that" AND ping:pong AND (yes:a2 OR yes:b2 OR yes:c2 OR ...x50 ) ) OR
( this:"that" AND ping:pong AND (yes:a3 OR yes:b3 OR yes:c3 OR ...x50 ) ) OR
( this:"that" AND ping:pong AND (yes:a4 OR yes:b4 OR yes:c4 OR ...x50 ) ) 

Upvotes: 0

Views: 124

Answers (1)

xpqz
xpqz

Reputation: 3737

Cloudant full text search is a front-end to Apache Lucene which has a default limit of the number of boolean clauses of 1024.

https://lucene.apache.org/core/6_5_0/core/org/apache/lucene/search/BooleanQuery.html#getMaxClauseCount--

Each of your OR clause contains about half a dozen sub-clauses, meaning that you fall foul of this limit.

If you really find yourself writing queries that tickle that limit, it may be worth investigating if you can restructure your documents a bit.

Upvotes: 1

Related Questions