Skip to content

An adapter to support Apache Solr in schranz-search/seal search abstraction. Part of the https://github.com/schranz-search/schranz-search project. READ-ONLY Repository

License

Notifications You must be signed in to change notification settings

schranz-search/seal-solr-adapter

Repository files navigation

Schranz Search Logo with a Seal on it with a magnifying glass
Logo created by Meine Wilma

SEAL
Solr Adapter



The SolrAdapter write the documents into a Apache Solr server instance. The Apache Solr server is running in the cloud mode as we require to use collections for indexes.

Note: This is part of the schranz-search/schranz-search project create issues in the main repository.

Note: This project is heavily under development and any feedback is greatly appreciated.

Installation

Use composer for install the package:

composer require schranz-search/seal schranz-search/seal-solr-adapter

Usage.

The following code shows how to create an Engine using this Adapter:

<?php

use Solr\Client;
use Solarium\Core\Client\Adapter\Curl;
use Schranz\Search\SEAL\Adapter\Solr\SolrAdapter;
use Schranz\Search\SEAL\Engine;
use Symfony\Component\EventDispatcher\EventDispatcher;

$client = new Client(new Curl(), new EventDispatcher(), [
    'endpoint' => [
        'localhost' => [
            'host' => '127.0.0.1',
            'port' => '8983',
            // authenticated required for configset api https://solr.apache.org/guide/8_9/configsets-api.html
            // alternative set solr.disableConfigSetsCreateAuthChecks=true in your server setup
            'username' => 'solr',
            'password' => 'SolrRocks',
        ],
    ]
]);

$engine = new Engine(
    new SolrAdapter($client),
    $schema,
);

Via DSN for your favorite framework:

solr://127.0.0.1:8983
solr://solr:[email protected]:8983

Authors