doutale7115
doutale7115
2018-08-10 07:49

如何在laravel / solarium中创建一个新的solr核心

已采纳

I am trying to make multi core Solr server and connect from PHP laravel. I did connect the solr and laravel but i cant find a way to create a core. I am also using solarium lib. Is it possible to create a new core with parameters from php?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongyi2425 dongyi2425 3年前
     $solr = SolrClient::factory(array(
                'base_url' => 'http://LOCALHOST:8983',
                'base_path' => '/solr',
            ));
            $response = $solr->get('admin/cores?action=CREATE&name='.$corename.'&instanceDir='.$corename.'&configSet=_default')->send()->json();
    

    Imports;

    use PSolr\Client\SolrClient;

    This is the solution that i used. I hope it helps someone else.

    点赞 评论 复制链接分享