MatchAgainstBundle
Very first release
Basé sur https://gist.github.com/zebigduck/1234419
composer require ciricihq/match-against-bundle Vous devez charger le bundle fourni config.yml afin d'avoir la phrase MATCH_AGAINST MySQL
imports :
- { resource: ../../src/Cirici/MatchAgainstBundle/Resources/config/config.yml }Faites une requête:
$ qbuilder
-> select ( ' sti.foreignId ' )
-> from ( ' CiriciMatchAgainstBundleEntitySearchTextIndex ' , ' sti ' )
-> where ( ' sti.model = :entityClass ' )
-> andWhere ( ' sti.field = :fieldName ' )
// ->andWhere("MATCH_AGAINST(sti.content, :text 'IN NATURAL LANGUAGE MODE') > :score")
-> andWhere ( " MATCH_AGAINST(sti.content, :text 'IN BOOLEAN MODE') > :score " )
-> setParameter ( ' entityClass ' , $ entity_class )
-> setParameter ( ' fieldName ' , $ field_name )
-> setParameter ( ' text ' , $ text )
-> setParameter ( ' score ' , $ score )
; Licencié sous la licence GNU GPL 2.0. Consultez le fichier LICENSE pour plus de détails.
Copyright 2015 © Cirici New Media