Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ciricihq/matchagainstbundle
A search bundle for symfony, using MySQL FULLTEXT MATCH AGAINST
https://github.com/ciricihq/matchagainstbundle
doctrine full-text full-text-search mysql symfony
Last synced: 5 days ago
JSON representation
A search bundle for symfony, using MySQL FULLTEXT MATCH AGAINST
- Host: GitHub
- URL: https://github.com/ciricihq/matchagainstbundle
- Owner: ciricihq
- License: gpl-2.0
- Created: 2015-11-13T12:26:41.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-11T22:09:57.000Z (over 8 years ago)
- Last Synced: 2024-12-03T09:38:54.468Z (25 days ago)
- Topics: doctrine, full-text, full-text-search, mysql, symfony
- Language: PHP
- Homepage:
- Size: 31.3 KB
- Stars: 8
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MatchAgainstBundle
==================Based on https://gist.github.com/ZeBigDuck/1234419
Installing
----------```bash
composer require ciricihq/match-against-bundle
```Usage
-----You must load the bundle provided config.yml in order to have the
`MATCH_AGAINST` MySQL sentence```yml
imports:
- { resource: ../../src/Cirici/MatchAgainstBundle/Resources/config/config.yml }
```Make a query:
```php
$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](http://cirici.com)