@@ -837,6 +837,14 @@ rum_TS_execute(QueryItem *curitem, void *arg, uint32 flags,
837
837
case OP_PHRASE :
838
838
839
839
/*
840
+ * If we get a MAYBE result, and the caller doesn't want that,
841
+ * convert it to NO. It would be more consistent, perhaps, to
842
+ * return the result of TS_phrase_execute() verbatim and then
843
+ * convert MAYBE results at the top of the recursion. But
844
+ * converting at the topmost phrase operator gives results that
845
+ * are bug-compatible with the old implementation, so do it like
846
+ * this for now.
847
+ *
840
848
* Checking for TS_EXEC_PHRASE_NO_POS has been moved inside
841
849
* rum_phrase_execute, otherwise we can lose results of phrase
842
850
* operator when position information is not available in index
@@ -849,7 +857,7 @@ rum_TS_execute(QueryItem *curitem, void *arg, uint32 flags,
849
857
case TS_YES :
850
858
return TS_YES ;
851
859
case TS_MAYBE :
852
- return TS_MAYBE ;
860
+ return ( flags & TS_EXEC_PHRASE_NO_POS ) ? TS_MAYBE : TS_NO ;
853
861
}
854
862
break ;
855
863