Jeet Raj Sah
Jeet Raj Sah

Reputation: 11

How to change the core on the fly while querying in laravel solarium

How to change the core on the fly while querying in laravel solarium. Let suppose I have three cores and I want to call all three cores in laravel solarium.

ex: The below file is my config and controller file.

Config File :

return [
    'endpoint' => [
        'Collection' => [
            'host' => '192.168.0.1',
            'port' => '8983',
            'path' => '/solr',
            'core' => 'products'
        ],
    ]
];

controller construction initiate client object

// create a client instance
        $this->client = new \Solarium\Client();
        $this->endpoint =  $this->client->createEndpoint(Config::get('solr.endpoint.Collection'));

search function

$query = $this->client->createSelect();
$query->setQuery("*:*");
$resultset = $this->client->select($query, $this->endpoint);

Above code only one core product is defined but my requirement is to get the data from 3 another core so where I have to define all cores so I can get the data.

Upvotes: 0

Views: 208

Answers (0)

Related Questions