Download the PHP package vertigolabs/doctrine-full-text-postgres without Composer
On this page you can find all versions of the php package vertigolabs/doctrine-full-text-postgres. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vertigolabs/doctrine-full-text-postgres
More information about vertigolabs/doctrine-full-text-postgres
Files in vertigolabs/doctrine-full-text-postgres
Package doctrine-full-text-postgres
Short Description Tools to use full-text searching in Postgresql with Doctrine
License MIT
Informations about the package doctrine-full-text-postgres
DoctrineFullTextPostrgres
A simple to use set of database types, and annotations to use postgresql's full text search engine with doctrine
Installation
-
Register Doctrine Annotation:
-
Register Doctrine Type:
-
Register Doctrine Event Subscriber
- Register Doctrine Functions
Symfony installation
- Add to config
Usage
-
Create your entity
You do not have to create column annotations for your fields that will hold your full text search vectors (tsvector) the columns will be created automatically. A TsVector annotation only requires the parameter. There are optional and parameters as well, however they are not used yet. You do not need to set data for your TsVector field, the data will come from the fields specified in the property automatically when the object is flushed to the database
-
Insert some data
You do not need to worry about setting any data to the fields marked with the TsVector annotation. The data for these fields will be automatically populated when you flush your changes to the database.
-
Query your database!
When you query your database, you'll query against the actual data. the query will be modified to search using the fields marked with the TsVector annotation automatically
If you'd like to retrieve the ranking of your full text search, simply use the tsrank function:
You can even order by rank:
TODO
- Add language to SQL field definition
- Add language and weighting to queries