Note that there are some explanatory texts on larger screens.

plurals
  1. POMATCH AGAINST script is not working with Symfony2
    text
    copied!<p>I try to set this class in my Symfony2 project : <a href="http://xlab.pl/en/full-text-searching/" rel="nofollow">http://xlab.pl/en/full-text-searching/</a> (Match against part)</p> <p>This class is supposed to allow me to use the Match against with doctrine like this :</p> <pre><code>$searchResult = $em-&gt;createQueryBuilder('uvaluo_user') -&gt;addSelect("MATCH_AGAINST (uvaluo_user.firstname, uvaluo_user.lastname, :name 'IN NATURAL MODE') as score") -&gt;add('where', 'MATCH_AGAINST (uvaluo_user.firstname, uvaluo_user.lastname, :name) &gt; 0.8') -&gt;setParameter('name', $name) -&gt;getQuery() -&gt;getResult(); </code></pre> <p>As they said in the website I put that in my config.yml of my app :</p> <pre><code>orm: auto_generate_proxy_classes: %kernel.debug% auto_mapping: true dql: string_functions: match_against: Uvaluo\UserBundle\Extension\Doctrine\MatchAgainstFunction </code></pre> <p>And I have the class MatchAgainstFunction like this</p> <pre><code>&lt;? namespace Uvaluo\UserBundle\Extension\Doctrine; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\AST\Functions\FunctionNode; /** * @example by https://gist.github.com/1234419 Jérémy Hubert * "MATCH_AGAINST" "(" {StateFieldPathExpression ","}* InParameter {Literal}? ")" */ class MatchAgainstFunction extends FunctionNode { //Content that I got in the website } </code></pre> <p>And finally when I try my code I get that following error :</p> <blockquote> <p>[Semantical Error] line 0, col 107 near 'MATCH_AGAINST': Error: Class 'MATCH_AGAINST' is not defined. 500 Internal Server Error - QueryException 1 linked Exception: QueryException »</p> </blockquote> <p>Do you know what can be the reason of that ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload