Closed freezlite closed 7 years ago
what does your config look like?
\VertigoLabs\DoctrineFullTextPostgres\ORM\Mapping\TsVectorType is the annotation class
There is no \VertigoLabs\DoctrineFullTextPostgres\ORM\Mapping\TsVectorType class at README.md
my config.yml
doctrine:
dbal:
driver: pdo_pgsql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# 2. Uncomment database_path in parameters.yml.dist
# 3. Uncomment next line:
# path: "%database_path%"
types:
tsvector: VertigoLabs\DoctrineFullTextPostgres\DBAL\Types\TsVector
orm:
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
auto_mapping: true
naming_strategy: doctrine.orm.naming_strategy.underscore
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
My User Entity
<?php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use VertigoLabs\DoctrineFullTextPostgres\ORM\Mapping as TsVectorType;
/**
* @ORM\Entity
* @ORM\Table(name="fos_user")
*/
class User extends BaseUser {
//...
/**
* @ORM\Column(type="text", nullable=true)
*/
protected $about;
/**
* @TsVectorType\TsVector(fields={"about"})
*/
protected $aboutFTS;
}
php bin/console doctrine:schema:update --force Nothing to update - your database is already in sync with the current entity metadata.
Now no errors but no aboutFTS field at database
There is no \VertigoLabs\DoctrineFullTextPostgres\ORM\Mapping\TsVectorType class at README.md
Sorry I meant VertigoLabs\DoctrineFullTextPostgres\ORM\Mapping\TsVector
So you've got an existing entity that you're trying to add the TsVector too? I'm just trying to replicate the issue so I can fix it
@freezlite Also, could you take a look at this https://github.com/jaimz22/DoctrineFullTextPostrgresBundle and give it a shot, I'm curious if it gives you the same issue.
@freezlite Also, could you take a look at this https://github.com/jaimz22/DoctrineFullTextPostrgresBundle and give it a shot, I'm curious if it gives you the same issue.
Problem 1
So you've got an existing entity that you're trying to add the TsVector too? I'm just trying to replicate the issue so I can fix it
I'm trying to add full text search for single column in exists Entity. But seems it not creates any new tsvector fields at database.
Ok, I understood. You should add to section for Symfony users lines about services.yml
vertigolabs.doctrinefulltextpostgres.listener:
class: VertigoLabs\DoctrineFullTextPostgres\Common\TsVectorSubscriber
tags:
- { name: doctrine.event_subscriber, connection: default }
and/or
mapping_types:
tsvector: tsvector
After this working fine. Problem that I'm not advanced user of symfony or doctrine and I need exact how to.
yes, the readme.md got updated in a pull request and it's incorrect. I'll update it. Or if you'd like you can make a new PR and I'll merge it.
Sorry, with my English I can make more mistakes.
I got it all updated, thanks.