Skip to content

Added test for using MatchAgainst in where clause#419

Open
stollr wants to merge 1 commit intobeberlei:masterfrom
stollr:test_match_in_where
Open

Added test for using MatchAgainst in where clause#419
stollr wants to merge 1 commit intobeberlei:masterfrom
stollr:test_match_in_where

Conversation

@stollr
Copy link

@stollr stollr commented Dec 14, 2023

I have added a unit test to show that the current MatchAgainst does not work in a where clause. I think the reason is that the DQL parser thinks it is a simple conditional expression and expects an operator after the AGAINST(...) token.

One can workaround this by adding > 0 to the condition:

  SELECT blank 
  FROM DoctrineExtensions\Tests\Entities\Blank AS blank 
- WHERE MATCH(blank.id) AGAINST ('3')
+ WHERE MATCH(blank.id) AGAINST ('3') > 0

I do not know if this should or can be fixed. But if not, it would be good to add a note somewhere. I can do that if I get a hint where to place it.

which shows that it is currently leading to an error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant