We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 734f74d + 49c5bd0 commit 75deb4dCopy full SHA for 75deb4d
src/SphinxQL.php
@@ -460,7 +460,9 @@ public function compileMatch()
460
$pre .= $this->escapeMatch($match['value']);
461
}
462
463
- $matched[] = '('.$pre.')';
+ if ($pre !== '') {
464
+ $matched[] = '('.$pre.')';
465
+ }
466
467
468
$matched = implode(' ', $matched);
tests/SphinxQL/SphinxQLTest.php
@@ -532,6 +532,14 @@ public function testMatch()
532
->getStored();
533
534
$this->assertCount(2, $result);
535
+
536
+ $result = SphinxQL::create(self::$conn)->select()
537
+ ->from('rt')
538
+ ->match('')
539
+ ->compile()
540
+ ->getCompiled();
541
542
+ $this->assertEquals('SELECT * FROM rt WHERE MATCH(\'\')', $result);
543
544
545
public function testEscapeMatch()
0 commit comments