MatchAgainstBundle
Very first release
https://gist.github.com/zebigduck/1234419に基づいています
composer require ciricihq/match-against-bundleMATCH_AGAINST mysql文を取得するには、bundleが提供されたconfig.ymlをロードする必要があります
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ファイルをご覧ください。
Copyright 2015©Cirici New Media