MatchAgainstBundle
Very first release
基于https://gist.github.com/zebigduck/1234419
composer require ciricihq/match-against-bundle您必须加载提供的bundle config.yml才能拥有MATCH_AGAINST mysql句子
imports :
- { resource: ../../src/Cirici/MatchAgainstBundle/Resources/config/config.yml }进行查询:
$ 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 )
;根据GNU GPL 2.0许可获得许可。查看LICENSE文件以获取更多详细信息。
版权所有2015©CIRICI新媒体