DocumentMapper
Mapper maps Content and Location objects to a Document objects, representing a document in Solr index storage.
Note that custom implementations might need to be accompanied by custom schema.
Constants¶
DOCUMENT_TYPE_IDENTIFIER_CONTENT ¶
Identifier of Content documents.
|
|
DOCUMENT_TYPE_IDENTIFIER_LOCATION ¶
Identifier of Location documents.
|
|
Methods¶
generateContentDocumentId() ¶
Generates the Solr backend document ID for Content object.
|
|
If $language code is not provided, the method will return prefix of the IDs of all Content's documents (there will be one document per translation). The above is useful when targeting all Content's documents, without the knowledge of it's translations.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$contentId | int|string | - | - |
$languageCode | string | null | - |
Return values
string
generateLocationDocumentId() ¶
Generates the Solr backend document ID for Location object.
|
|
If $language code is not provided, the method will return prefix of the IDs of all Location's documents (there will be one document per translation). The above is useful when targeting all Location's documents, without the knowledge of it's Content's translations.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$locationId | int|string | - | - |
$languageCode | string | null | - |
Return values
string
mapContentBlock() ¶
Maps given Content and it's Locations to a collection of nested Documents, one per translation.
Each Content Document contains nested Documents representing it's Locations.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$content | Content | - | - |
Return values
array<string|int, Document>