V
V
Valery2013-07-03 09:26:08
symfony
Valery, 2013-07-03 09:26:08

How to create a FULLTEXT index in Doctrine2?

Good morning.

The question is in the title.
There is a field of type text:

use Doctrine\ORM\Mapping as ORM;
...
/**
 * @ORM\Table(name="node",
 *      indexes={
 *          @ORM\Index(name="url", columns={"url"})
 *      })
*/
...
/**
@ORM\Column(type="text")
*/
private $url = '';


When updating the database schema, it throws an error:
SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'url' used in key specification without a key length

Of course, I can manually create an index. But it would be desirable through the doctrine. How to set FULLTEXT index?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly, 2013-07-03
@taliban

No way, the doctrine in general is not so good friends with Mayis =) And it’s more tembole with fulltext.
But, if you still found a solution, I would also like to hear, because I searched for a long time and eventually came to such a bad conclusion.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question