BooleanQuery mustNot and should not working

#1

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: https://github.com/couchbase/couchbase-java-client/pull/13

Thanks
Chander

#2

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).

#3

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.

Thanks
Chander

#4

Not an internal branch, but we made an internal work in a separate package, temporarily. Have a look at the BooleanQuery there: https://github.com/couchbase/couchbase-java-client/blob/master/src/main/java/com/couchbase/client/java/fts/queries/BooleanQuery.java
Note that by next week new implementations like the one I linked should be reintroduced in the “com.couchbase.client.java.search.query” 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: https://github.com/couchbaselabs/sdk-rfcs/blob/drafts/0010-cbft/rfc/0010-cbft.md