BooleanQuery mustNot and should not working

Couchbase server: couchbase-server-enterprise_4.5.0-beta-macos_x86_64
Java Client: 2.2.7

BooleanQuery.on(INDEX).mustNot(query).build() and BooleanQuery.on(INDEX).should generates a JSON that is not compatible with Bleve which generates a response like so.

  1. mustNot - err: unknown query type
  2. must not clause must be disjunction and
  3. should clause must be a disjunction

I have fixed the BooleanQuery locally and was able to test successfully. Pull request is here:


The FTS support in 2.2.x was heavily experimental, and based on an older version of the search service. It’s been mostly redone in the master branch (for now under the FTS namespace, but that will be changed back to ‘search’ before the branch is released as 2.3 and couchbase server 4.5 hits GA).

Thanks for getting back. please go ahead and close the pull request. btw, the fix was in master branch, not sure about the FTS namespace, I guess you are referring to internal branches which are non-opensource. Totally understand that its beta, and it was experimental. I guess, my question is do we still report bugs or wait for GA ? At this point we are heavily evaluating 4.5 beta, and would be great to see if these are known bugs already being worked on somewhere.

Btw, love CBFT so far.


Not an internal branch, but we made an internal work in a separate package, temporarily. Have a look at the BooleanQuery there:
Note that by next week new implementations like the one I linked should be reintroduced in the “” package (where you found the old implementation) so these confusions will be avoided.

This is the current draft of the API design document for FTS support in the SDKs by the way: