floriansemm / SolrBundle

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

Index discriminator columns, support for virtual attributes/fields .. #158

Closed jadelrab closed 7 years ago

jadelrab commented 7 years ago

Hello,

Is there a way to add discriminator columns into schema index ? I've tried to add it as a virtual attribute (without @ ORM\Column annotation) but with "getter" set to a public method and it not working although it shows in solr:schema:show command as "_document_type_s" ..

     /**
     * @Solr\Field(type="string", name="type", getter="getDocumentType")
     *
     * @var String
     */
    private $documentType;

I checked the closed pull request and found an implementation for virtual fields by @zquintana but it seems missed in master branch

Thanks

Koalabaerchen commented 7 years ago

This bundle is designed for Doctrine Entities. Other datasources are not supported, but you can implement your own stuff and use the underlying Solarium Lib to index documents.

Source

jadelrab commented 7 years ago

Hi @Koalabaerchen ,

Thanks for the info, but regarding the discriminator field it is totally a Doctrine entity related, anyway, I've found a simple way to put the attribute with its value in the entity class itself,

Thanks,

zquintana commented 7 years ago

@jadelrab if you are looking for this feature, I've forked this project and added some additional goodies for a recent project that had additional requirements. https://github.com/zquintana/SunSearchBundle.