vertigolabs/doctrine-full-text-postgres-bundle

A bundle for the VertigoLabs DoctrineFullTextPostgres package

v1.0.3 2015-09-20 15:46 UTC

This package is auto-updated.

Last update: 2024-12-05 19:14:45 UTC


README

Symfony2 Bundle for the DoctrineFullTextPostgres package

Install

Add the DoctrineFullTextPostgresBundle to your composer.json:

{
    "require": {
        "vertigolabs/doctrine-full-text-postgres-bundle": "v1.0"
	}
}

Or require it directly with composer:

$ php composer.phar require vertigolabs/doctrine-full-text-postgres-bundle:v1.0

The bundle will be installed in your projects vendor directory in vertigolabs/doctrine-full-text-postgres-bundle/

Enable

Add the bundle to your kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
    	//...
    	new VertigoLabs\DoctrineFullTextPostgresBundle(),
    );
}

Configure Doctrine

# Doctrine Configuration
doctrine:
    dbal:
        types:
            tsvector: VertigoLabs\DoctrineFullTextPostgres\DBAL\Types\TsVector
        mapping_types:
        	tsvector: tsvector
    orm:
        entity_managers:
            default:
                dql:
                    string_functions:
                        tsquery: VertigoLabs\DoctrineFullTextPostgres\ORM\Query\AST\Functions\TsQueryFunction
                        tsrank: VertigoLabs\DoctrineFullTextPostgres\ORM\Query\AST\Functions\TsRankFunction
                        tsrankcd: VertigoLabs\DoctrineFullTextPostgres\ORM\Query\AST\Functions\TsRankCDFunction

services:
    vertigolabs.doctrinefulltextpostgres.listener:
        class: VertigoLabs\DoctrineFullTextPostgres\Common\TsVectorSubscriber
        tags:
            - { name: doctrine.event_subscriber, connection: default }

Usage

refer to the read me for the DoctrineFullTextPostgres package for usage instructions