CursorMarkIdFetcher
extends AbstractIdFetcher
in package
Plugin to get IDs for a sitemap from a backend using cursor marks (if supported).
Tags
Table of Contents
- $defaultParams : array<string|int, mixed>
- Default parameters to send to Solr with each request
- $prevCursorMark : string
- Previous cursor mark
- $searchService : Service
- Search service
- __construct() : mixed
- Constructor.
- getIdsFromBackend() : array<string|int, mixed>
- Retrieve a batch of IDs. Returns an array with two possible keys: ids (the latest set of retrieved IDs) and nextOffset (an offset which can be passed to the next call to this function to retrieve the next page). When all IDs have been retrieved, the nextOffset value MUST NOT be included in the return array.
- getInitialOffset() : string
- Get the initial offset to seed the search process
- setupBackend() : void
- Set up the backend.
Properties
$defaultParams
Default parameters to send to Solr with each request
protected
array<string|int, mixed>
$defaultParams
= [
'q' => '*:*',
'start' => 0,
// Always 0 when using a cursorMark
'wt' => 'json',
// Override any default timeAllowed since it cannot be used with
// cursorMark
'timeAllowed' => -1,
]
$prevCursorMark
Previous cursor mark
protected
string
$prevCursorMark
= ''
$searchService
Search service
protected
Service
$searchService
Methods
__construct()
Constructor.
public
__construct(Service $searchService) : mixed
Parameters
- $searchService : Service
-
Search service
Return values
mixed —getIdsFromBackend()
Retrieve a batch of IDs. Returns an array with two possible keys: ids (the latest set of retrieved IDs) and nextOffset (an offset which can be passed to the next call to this function to retrieve the next page). When all IDs have been retrieved, the nextOffset value MUST NOT be included in the return array.
public
getIdsFromBackend(string $backend, string $cursorMark, int $countPerPage, array<string|int, mixed> $filters) : array<string|int, mixed>
Parameters
- $backend : string
-
Search backend ID
- $cursorMark : string
-
String representing progress through set
- $countPerPage : int
-
Page size
- $filters : array<string|int, mixed>
-
Filters to apply to the search
Return values
array<string|int, mixed> —getInitialOffset()
Get the initial offset to seed the search process
public
getInitialOffset() : string
Return values
string —setupBackend()
Set up the backend.
public
setupBackend(string $backend) : void
Parameters
- $backend : string
-
Search backend ID