mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
MATCH Query : Access array offset on value of type null in DQL parser #6509
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aguidis on GitHub (Aug 2, 2020).
Bug Report
Summary
I installed the DoctrineExtensions to use the MATCH AGAINST query.
I added this clause in my repository method:
Current behavior
When the
MATCHclause is parsed, the following error is triggered in the Parser because$this->lexer->lookaheadisnull.@beberlei commented on GitHub (Sep 13, 2020):
@greg0ire this sounds a lot like that bug we had early in 2.7 cycle, do you remember what it was?
@greg0ire commented on GitHub (Sep 13, 2020):
@beberlei it doesn't ring a bell but I found this in the issues: https://github.com/doctrine/orm/issues/7983
@bigwhoop commented on GitHub (Nov 9, 2020):
Hi. I had this error in v2.7.3 as well, but it seems to be fixed with v2.7.4.
@greg0ire commented on GitHub (Nov 11, 2020):
@aguidis can you try upgrading?
@Bruspashko commented on GitHub (Nov 16, 2020):
@greg0ire I'm having the same problem on 2.7.4. It's basically because Parser doesn't know how to handle Match Against. It expects a comparison operator, and nothing is passed.
@bigwhoop commented on GitHub (Jan 9, 2021):
IIRC correctly the query needs to have a comparison like
= 1(or= 0for "not matching") in boolean mode. Example:@julkwel commented on GitHub (Jan 10, 2021):
@bigwhoop this fix the error but return no results ( i don't know if i have a mistake in this query ).
I'm sure that I have this text at column
title:Lorem ipsum need to query, and my query :this return empty.
@pgrzesiecki commented on GitHub (Nov 28, 2021):
Yes it return no data because comparing this to
= 1or= 0this query is not validmatch againstquery (especially in mariadb).@mklewitz commented on GitHub (Sep 2, 2022):
MATCH AGAINST doesn't simply return 0 or 1, but a score. So this will work:
MATCH (alias.fieldName) AGAINST(:searchValue BOOLEAN) > 0You can even select the score as scalar value and/or order by the best match: