ciricihq/match-against-bundle
最新稳定版本:v1.0.0
Composer 安装命令:
composer require ciricihq/match-against-bundle
包简介
A search bundle for symfony, using MySQL FULLTEXT MATCH AGAINST
README 文档
README
Based on https://gist.github.com/ZeBigDuck/1234419
Installing
composer require ciricihq/match-against-bundle
Usage
You must load the bundle provided config.yml in order to have the
MATCH_AGAINST MySQL sentence
imports: - { resource: ../../src/Cirici/MatchAgainstBundle/Resources/config/config.yml }
Make a query:
$qbuilder ->select('sti.foreignId') ->from('Cirici\MatchAgainstBundle\Entity\SearchTextIndex', '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) ;
License
Licensed under the GNU GPL 2.0 license. Check out the LICENSE file for more
details.
Copyright 2015 © Cirici New Media
统计信息
- 总下载量: 3.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2016-03-04