Full-text doctrine for multiple fields

I have an entity with some attributes, and I want to index some of them for full text.

* @Index(name="search", columns={"description", "short_description", "name"}, flags={"fulltext"})})

Now, if I execute the request with MATCH(description, short_description) AGAINST (...), I get:

Unable to find FULLTEXT index matching column list

If I index for full-text only one column:

 * @Index(columns={"description"}, flags={"fulltext"})})

And then try using MATCH (description) AGAINST (...) everything works correctly.
So how can I index multiple columns?

Thank.

+4
source share
2 answers

, , .
:

* @Index(name="search", columns={"description", "short_description", "name"}, flags={"fulltext"})})

:

MATCH(description, short_description, name) AGAINST (...)

.
.

+1

.

/**
 * @Entity
 * @Table(name="table",indexes={@index(name="foo_index", columns={"foo"}),@index(name="bar_index", columns={"bar"})})
 */

, Doctrine2 ORM MATCH AGAINST, , .

Lucene, Elasticsearch Apache Solr.

0

All Articles