floriansemm / SolrBundle

Solr-Integration into Symfony and Doctrine2
http://floriansemm.github.io/SolrBundle
MIT License
123 stars 73 forks source link

\DateTime properties cannot be indexed #134

Closed Martin1982 closed 8 years ago

Martin1982 commented 8 years ago

When running solr:index:populate on an entity with this field;

/**
 * @var \DateTime
 *
 * @Solr\Field(type="date")
 */
protected $publicationDateStart;

The following error occurs:

A error occurs: no declaration for document found in entity DateTime

Martin1982 commented 8 years ago

I just noticed this is solved in issue #123 but having it in the README.md would help not to fall for it again ;)

Martin1982 commented 8 years ago

While working on my index I came across another error from Solr complaining about the date format. In the end this was the solution that worked for me;

 * @Solr\Field(type="datetime", getter="format('Y-m-d\TH:i:s.z\Z')")
floriansemm commented 8 years ago

Thanks good point. Documentation is now update to date.