Search
in
Define Search Handler This is the search handler interface definition
Tags
Table of Contents
- MAX_ENTRIES = 1000000
- The maximum entries
- AddDocument() : Result
- Add a document Add a document to search index.
- DeleteDocument() : Result
- Delete a document Delete a document from search index.
- DeleteDocumentList() : Result
- Delete a document list
- Execute() : Result
- Do search Execute the search operation
- GetServerVersion() : string|null
- Get servers version. Can be null
- GetVersion() : string
- Check if is connected Get the version of the search server.
- IndexList() : Result
- Index list
Constants
MAX_ENTRIES
The maximum entries
public
mixed
MAX_ENTRIES
= 1000000
Methods
AddDocument()
Add a document Add a document to search index.
public
AddDocument(int|string $id, string $type, mixed $data) : Result
Parameters
- $id : int|string
-
A object id
- $type : string
-
The type of object
- $data : mixed
-
The document data with key value pairs or a solr document instance
Return values
Result —A system result object
DeleteDocument()
Delete a document Delete a document from search index.
public
DeleteDocument(int|string|array<string|int, mixed> $id, string $type) : Result
Parameters
- $id : int|string|array<string|int, mixed>
-
A object id
- $type : string
-
The type of object
Return values
Result —A system result object
DeleteDocumentList()
Delete a document list
public
DeleteDocumentList(string|null $type) : Result
Delete a document list from search index. When no type is given then delete the hole index
Parameters
- $type : string|null
-
The type of object
Return values
Result —A system result object
Execute()
Do search Execute the search operation
public
Execute(array<string|int, mixed> $filter, array<string|int, mixed> $order, array<string|int, mixed> $payload, string|null $language, object|null $handler) : Result
Parameters
- $filter : array<string|int, mixed>
-
The search query
- $order : array<string|int, mixed>
-
The search order definition
- $payload : array<string|int, mixed>
-
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 search string A search term
- $language : string|null
-
The request language
- $handler : object|null
-
A search plugin instance or other class that implements method BuildEntry
Return values
Result —A system result object with data table conform response array
GetServerVersion()
Get servers version. Can be null
public
GetServerVersion() : string|null
Return values
string|null —GetVersion()
Check if is connected Get the version of the search server.
public
GetVersion() : string
Return values
string —Connection possible
IndexList()
Index list
public
IndexList(string $type, array<string|int, mixed> $list[, bool $is_full = false ][, int|string|object $correct_count = -1 ]) : Result
Handler to index a list of files
Parameters
- $type : string
-
The system type name
- $list : array<string|int, mixed>
-
A list of files
- $is_full : bool = false
-
When set to true the update will do a diff check of the attribute set
- $correct_count : int|string|object = -1
-
Corrected count, when origin was is composed of several lists