qimnet / solrclient-bundle

QIMNET SolrClient 包(alpha版本)

安装: 34

依赖: 1

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

类型:symfony-bundle

v1.2 2013-03-08 10:17 UTC

This package is not auto-updated.

Last update: 2024-09-14 14:02:59 UTC


README

用于将 PECL SolrClient 扩展集成到 Symfony 2 中。

功能

  • 自动索引和删除 Doctrine 实体
  • 实时索引或批量索引

配置

qimnet_solr_client:          

    # list of entities that should be indexed by the batch command.
    entities:             [] 

    # see the SolrClient documentation on http://php.met for details about the options.
    client_options:       
        port:                 8080 
        hostname:             localhost 
        secure:               false 
        path:                 ~ 
        wt:                   ~ 
        login:                ~ 
        password:             ~ 
        proxy_host:           ~ 
        proxy_port:           ~ 
        proxy_login:          ~ 
        proxy_password:       ~ 
        timeout:              ~ 
        ssl_cert:             ~ 
        ssl_key:              ~ 
        ssl_keypassword:      ~ 
        ssl_cainfo:           ~ 
        ssl_capath:           ~ 

Doctrine 实体注释

可以使用以下注释自动插入 Doctrine 实体。

    use Qimnet\QimnetSolrClientBundle\Annotation as Solr;

    class Entity
    {
        /**
        * @Solr\Indexable("id"=true)
        **/
        protected $id;
        /**
        * @Solr\Indexable
        **/
        protected $content;
        /**
        * @Solr\NeedsIndex
        **/
        protected $needs_index;
        /**
        * @Solr\Indexable(solr_name="tag")
        **/
        public function getTags() {
            return array("tag1", "tag2");
        }
    }

批量索引更新

如果实体中没有找到 @Solr\NeedsIndex,则索引会自动更新。

要手动启动索引,请使用 qimnet:solr:index 命令。

服务

定义了以下服务

qimnet.solr.client                            container SolrClient
qimnet.solr.indexable                         container Qimnet\SolrClientBundle\Doctrine\IndexableListener
qimnet.solr.indexer                           container Qimnet\SolrClientBundle\Doctrine\Indexer

许可证

Qimnet SolrClient 在 MIT 许可证下可用。

版权所有 Antoine Guigan, 2012

QIMNET