@@ -780,14 +780,14 @@ private static void checkFullTextSearchDisjunctions(
780780 Set <Failure > failures
781781 ) {
782782 condition .forEachUp (Or .class , or -> {
783- boolean left = checkFullTextSearchInDisjunctions (or .left ());
784- boolean right = checkFullTextSearchInDisjunctions (or .right ());
783+ boolean left = onlyFullTextFunctionsInExpression (or .left ());
784+ boolean right = onlyFullTextFunctionsInExpression (or .right ());
785785 if (left ^ right ) {
786786 Holder <String > elementName = new Holder <>();
787787 if (left ) {
788- or .right ().forEachDown (FullTextFunction .class , ftf -> elementName .set (typeNameProvider .apply (ftf )));
789- } else {
790788 or .left ().forEachDown (FullTextFunction .class , ftf -> elementName .set (typeNameProvider .apply (ftf )));
789+ } else {
790+ or .right ().forEachDown (FullTextFunction .class , ftf -> elementName .set (typeNameProvider .apply (ftf )));
791791 }
792792 failures .add (
793793 fail (
@@ -805,22 +805,22 @@ private static void checkFullTextSearchDisjunctions(
805805 /**
806806 * Checks whether an expression contains just full text functions or negations (NOT) and combinations (AND, OR) of full text functions
807807 *
808- * @param expression parent expression to add to the failure message
808+ * @param expression expression to check
809809 * @return true if all children are full text functions or negations of full text functions, false otherwise
810810 */
811- private static boolean checkFullTextSearchInDisjunctions (Expression expression ) {
811+ private static boolean onlyFullTextFunctionsInExpression (Expression expression ) {
812812 if (expression instanceof FullTextFunction ) {
813- return false ;
813+ return true ;
814814 } else if (expression instanceof Not || expression instanceof BinaryLogic ) {
815815 for (Expression child : expression .children ()) {
816- if (checkFullTextSearchInDisjunctions (child )) {
817- return true ;
816+ if (onlyFullTextFunctionsInExpression (child ) == false ) {
817+ return false ;
818818 }
819819 }
820- return false ;
820+ return true ;
821821 }
822822
823- return true ;
823+ return false ;
824824 }
825825
826826 /**
0 commit comments