Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for using MatchAgainst in where clause #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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