VuFind API Documentation

SolrDefaultBackendFactory extends AbstractSolrBackendFactory
in package

Factory for the default SOLR backend.

Tags
category

VuFind

author

David Maus maus@hab.de

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Site

Table of Contents

$allowFallbackForIndexName  : bool
When looking up the Solr index name config setting, should we allow fallback into the main configuration (true), or limit ourselves to the search config (false)?
$backendClass  : string
Solr backend class
$config  : PluginManager
VuFind configuration reader
$connectorClass  : string
Solr connector class
$defaultIndexName  : string
Solr index name (used as default if $this->indexNameSetting is unset in the config).
$facetConfig  : string
Facet configuration file identifier.
$indexNameSetting  : string
Name of index configuration setting to use to retrieve Solr index name (core or collection).
$logger  : LoggerInterface
Logger.
$mainConfig  : string
Primary configuration file identifier.
$mergedIndexConfig  : array<string|int, mixed>|null
Merged index configuration
$recordCollectionClass  : string
Record collection class for RecordCollectionFactory
$recordCollectionFactoryClass  : string
Record collection factory class
$searchConfig  : string
Search configuration file identifier.
$searchYaml  : string
YAML searchspecs filename.
$serviceLocator  : ContainerInterface
Service container.
$uniqueKey  : string
Solr field used to store unique identifiers
__construct()  : mixed
Constructor
__invoke()  : Backend
Create service
setup()  : void
Initialize the factory
createBackend()  : Backend
Create the SOLR backend.
createConnector()  : Connector
Create the SOLR connector.
createConnectorCache()  : StorageInterface|null
Create cache for the connector if enabled in configuration
createHttpClient()  : Client
Create HTTP Client
createListeners()  : void
Create listeners.
createLuceneSyntaxHelper()  : LuceneSyntaxHelper
Create Lucene syntax helper.
createQueryBuilder()  : QueryBuilder
Create the query builder.
createRecordCollectionFactory()  : RecordCollectionFactoryInterface
Create the record collection factory.
createSimilarBuilder()  : SimilarBuilder
Create the similar records query builder.
getCreateRecordCallback()  : callable|null
Get the callback for creating a record.
getCustomFilterListener()  : mixed
Get a custom filter listener for the backend (or null if not needed).
getDeduplicationListener()  : DeduplicationListener
Get a deduplication listener for the backend
getDefaultParametersListener()  : DeduplicationListener
Get a default parameters listener for the backend
getFlatIndexConfig()  : array<string|int, mixed>
Get the Index section of the highest-priority configuration file (for use in cases where fallback is not desired).
getHiddenFilters()  : array<string|int, mixed>
Get all hidden filter settings.
getHideFacetValueListener()  : mixed
Get a hide facet value listener for the backend
getHierarchicalFacetListener()  : HierarchicalFacetListener
Get a hierarchical facet listener for the backend
getHttpOptions()  : array<string|int, mixed>
Get HTTP options for the client
getIndexConfig()  : mixed
Get an index-related configuration setting.
getIndexName()  : string
Get the name of the Solr index (core or collection).
getInjectConditionalFilterListener()  : InjectConditionalFilterListener
Get a Conditional Filter Listener
getInjectHighlightingListener()  : InjectHighlightingListener
Get a highlighting listener for the backend
getMergedIndexConfig()  : array<string|int, mixed>
Merge together the Index sections of all eligible configuration files and return the result as an array.
getPrioritizedConfigsForIndexSettings()  : array<string|int, string>
Return an ordered array of configurations to check for index configurations.
getSolrBaseUrls()  : array<string|int, string>
Get the Solr base URL(s) (without the path to the specific index)
getSolrUrl()  : string|array<string|int, mixed>
Get the full Solr URL(s) (including index path part).
loadSpecs()  : array<string|int, mixed>
Load the search specs.

Properties

$allowFallbackForIndexName

When looking up the Solr index name config setting, should we allow fallback into the main configuration (true), or limit ourselves to the search config (false)?

protected bool $allowFallbackForIndexName = false

$connectorClass

Solr connector class

protected string $connectorClass = \VuFindSearch\Backend\Solr\Connector::class

$defaultIndexName

Solr index name (used as default if $this->indexNameSetting is unset in the config).

protected string $defaultIndexName = ''

$indexNameSetting

Name of index configuration setting to use to retrieve Solr index name (core or collection).

protected string $indexNameSetting = 'default_core'

$mergedIndexConfig

Merged index configuration

protected array<string|int, mixed>|null $mergedIndexConfig = null

$recordCollectionClass

Record collection class for RecordCollectionFactory

protected string $recordCollectionClass = \VuFindSearch\Backend\Solr\Response\Json\RecordCollection::class

$recordCollectionFactoryClass

Record collection factory class

protected string $recordCollectionFactoryClass = \VuFindSearch\Backend\Solr\Response\Json\RecordCollectionFactory::class

Methods

__invoke()

Create service

public __invoke(ContainerInterface $sm, string $name[, array<string|int, mixed> $options = null ]) : Backend
Parameters
$sm : ContainerInterface

Service manager

$name : string

Requested service name

$options : array<string|int, mixed> = null

Extra options (unused)

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
Backend

setup()

Initialize the factory

public setup(ContainerInterface $sm) : void
Parameters
$sm : ContainerInterface

Service manager

Return values
void

createConnectorCache()

Create cache for the connector if enabled in configuration

protected createConnectorCache(Config $searchConfig) : StorageInterface|null
Parameters
$searchConfig : Config

Search configuration

Return values
StorageInterface|null

createHttpClient()

Create HTTP Client

protected createHttpClient([int $timeout = null ][, array<string|int, mixed> $options = [] ][, string $url = null ]) : Client
Parameters
$timeout : int = null

Request timeout

$options : array<string|int, mixed> = []

Other options

$url : string = null

Request URL (needed for proper local address check when the client is being proxified)

Return values
Client

getCreateRecordCallback()

Get the callback for creating a record.

protected getCreateRecordCallback() : callable|null

Returns a callable or null to use RecordCollectionFactory's default method.

Return values
callable|null

getCustomFilterListener()

Get a custom filter listener for the backend (or null if not needed).

protected getCustomFilterListener(BackendInterface $backend, Config $facet) : mixed
Parameters
$backend : BackendInterface

Search backend

$facet : Config

Configuration of facets

Return values
mixed

null|CustomFilterListener

getFlatIndexConfig()

Get the Index section of the highest-priority configuration file (for use in cases where fallback is not desired).

protected getFlatIndexConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHiddenFilters()

Get all hidden filter settings.

protected getHiddenFilters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHideFacetValueListener()

Get a hide facet value listener for the backend

protected getHideFacetValueListener(BackendInterface $backend, Config $facet) : mixed
Parameters
$backend : BackendInterface

Search backend

$facet : Config

Configuration of facets

Return values
mixed

null|HideFacetValueListener

getHttpOptions()

Get HTTP options for the client

protected getHttpOptions(string $url) : array<string|int, mixed>
Parameters
$url : string

URL being requested

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

getIndexConfig()

Get an index-related configuration setting.

protected getIndexConfig(string $setting[, mixed $default = null ][, bool $fallback = true ]) : mixed
Parameters
$setting : string

Name of setting

$default : mixed = null

Default value if unset

$fallback : bool = true

Should we fall back to main config if the setting is absent from the search config file?

Return values
mixed

getIndexName()

Get the name of the Solr index (core or collection).

protected getIndexName() : string
Return values
string

getMergedIndexConfig()

Merge together the Index sections of all eligible configuration files and return the result as an array.

protected getMergedIndexConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPrioritizedConfigsForIndexSettings()

Return an ordered array of configurations to check for index configurations.

protected getPrioritizedConfigsForIndexSettings() : array<string|int, string>
Return values
array<string|int, string>

getSolrBaseUrls()

Get the Solr base URL(s) (without the path to the specific index)

protected getSolrBaseUrls() : array<string|int, string>
Return values
array<string|int, string>

getSolrUrl()

Get the full Solr URL(s) (including index path part).

protected getSolrUrl() : string|array<string|int, mixed>
Return values
string|array<string|int, mixed>

loadSpecs()

Load the search specs.

protected loadSpecs() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results