\midcom_services_indexer_backend_solr

Solr implementation of the indexer backend.

This works by communicating with solr over http requests.

Summary

Methods
Properties
Constants
__construct()
index()
delete()
delete_all()
query()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
post()
prepare_request()
send_request()
$_index_name
$factory
N/A

Properties

$_index_name

$_index_name : 

The "index" to use (Solr has single index but we add this as query constraint as necessary

Type

Methods

__construct()

__construct(  $index_name = null) 

Constructor is empty at this time.

Parameters

$index_name

index()

index(array<mixed,\midcom_services_indexer_document>  $documents) : boolean

Adds a document to the index.

Any warning will be treated as error.

Note, that $document may also be an array of documents without further changes to this backend.

Parameters

array<mixed,\midcom_services_indexer_document> $documents

A list of objects.

Returns

boolean —

Indicating success.

delete()

delete(array  $RIs) : boolean

Removes the document(s) with the given resource identifier(s) from the index.

Parameters

array $RIs

The resource identifier(s) of the document(s) that should be deleted.

Returns

boolean —

Indicating success.

delete_all()

delete_all(  $constraint) : boolean

Clear the index completely or by constraint.

This will drop the current index.

Parameters

$constraint

Returns

boolean —

Indicating success.

query()

query(  $querystring, \midcom_services_indexer_filter  $filter = null, array  $options = array()) : array<mixed,\midcom_services_indexer_document>

Query the index and, if set, restrict the query by a given filter.

Parameters

$querystring
\midcom_services_indexer_filter $filter

An optional filter used to restrict the query. This may be null indicating no filter.

array $options

Options to modify the backend behavior

Returns

array<mixed,\midcom_services_indexer_document> —

An array of documents matching the query

post()

post(  $optimize = false) 

Posts the xml to the suggested url using Buzz.

Parameters

$optimize

prepare_request()

prepare_request(  $action,   $body = null) 

Parameters

$action
$body

send_request()

send_request(\GuzzleHttp\Psr7\Request  $request) 

Parameters

\GuzzleHttp\Psr7\Request $request