\FAA\Handler\SearchSolr

Summary

Methods
Properties
Constants
__construct()
GetVersion()
DeleteDocument()
DeleteDocumentList()
AddDocument()
Execute()
BuildEntry()
IndexList()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
getEntry()
setupFilter()
buildDocument()
_toId()
client()
$interface
N/A

Properties

$interface

$interface :null|boolean|\SolrClient

The search interface Local solr client

Type

null|boolean|\SolrClient—A solr client instance

Methods

__construct()

__construct()

GetVersion()

GetVersion(): string

Get the server version Get the version string of the related and configured solr search server

Returns

string —

The version number

DeleteDocument()

DeleteDocument(integer|string  $id,string  $type): \FAA\Obj\Result

Delete a document Delete a document from search index.

Parameters

integer|string $id

A object id

string $type

The type of object

Returns

\FAA\Obj\Result —

A system result object

DeleteDocumentList()

DeleteDocumentList(string  $type): \FAA\Obj\Result

Delete a document list Delete a document list from search index.

Parameters

string $type

The type of object

Returns

\FAA\Obj\Result —

A system result object

AddDocument()

AddDocument(integer|string  $id,string  $type,array|\SolrDocument  $data): \FAA\Obj\Result

Add a document Add a document to search index.

Parameters

integer|string $id

A object id

string $type

The type of object

array|\SolrDocument $data

The document data with key value pairs or a solr document instance

Returns

\FAA\Obj\Result —

A system result object

Execute()

Execute(array  $filter,array  $order,array  $payload,string  $language,\FAA\Interfaces\SearchPlugin|mixed  $handler): \FAA\Obj\Result

Do search Execute the search operation

Parameters

array $filter

The search query

array $order

The search order definition

array $payload

The search response definition start integer The start index length integer The count of elements to fetch fields array A list of fields to include echo int The data tables echo counter

string $language

The request language

\FAA\Interfaces\SearchPlugin|mixed $handler

A search plugin instance or, a class wih method BuildEntry

Returns

\FAA\Obj\Result —

A system result object with data table conform response array

BuildEntry()

BuildEntry(\stdClass  $doc,string  $language,array|null  $extra = null): \FAA\Obj\Search\Response\General

Build entry

Convert the search result to frontend object row

Parameters

\stdClass $doc

The search response

string $language

The request language

array|null $extra

Additional fields

Returns

\FAA\Obj\Search\Response\General

A general search response object

IndexList()

IndexList(string  $type,array  $list,\FAA\Obj\CronJob  $cron,boolean  $is_full = false): \FAA\Obj\Result

Index list

Handler to index a list of files. Doeas a cleanup of storage on demand, when full is set to true.

Parameters

string $type

The system type name

array $list

A list of files

\FAA\Obj\CronJob $cron

A cron job instance

boolean $is_full

When set to true the update will do an diff check of the attribute set

Returns

\FAA\Obj\Result —

A system result object

getEntry()

getEntry(integer|string  $id,string  $type,string  $source): \FAA\Obj\Generic\BaseContent

Get entry Get a system object

Parameters

integer|string $id

A object id

string $type

A type name

string $source

The original index path

Returns

\FAA\Obj\Generic\BaseContent —

Basic content or null

setupFilter()

setupFilter(array<mixed,\FAA\Interfaces\SearchFilter>  $filters,string  $search): string

To search string Add the given filters to the search string.

Parameters

array<mixed,\FAA\Interfaces\SearchFilter> $filters

A list of search filters

string $search

The search string

Returns

string —

The search string with filters

buildDocument()

buildDocument(integer|string  $id,string  $type,array  $data): \SolrInputDocument

Create document Convert the given fields to sol search client document

Parameters

integer|string $id

A object id

string $type

Object type name

array $data

A list of elements with fields: 'field', 'type' and 'value'

Returns

\SolrInputDocument —

A solr client input document

_toId()

_toId(  $id,  $type)

Parameters

$id
$type

client()

client(): boolean|null|\SolrClient

Setup client Connect to local solr server and return instance.

This method is cached

Returns

boolean|null|\SolrClient