-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NGSTACK-843 document factory documentation
- Loading branch information
Katarina Miočić
committed
Sep 10, 2024
1 parent
b628a66
commit 258439d
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
DocumentFactory | ||
=============== | ||
DocumentFactory is an implementation of field mappers for Elasticsearch modeled after the Solr implementation using the | ||
template method pattern. It implements the Elasticsearch ``DocumentFactoryInterface`` and its methods ``fromContent()`` | ||
and ``fromLocation()`` add fields to document. These methods index the fields from the suitable field mappers. | ||
|
||
``DocumentFactory`` depends on the elasticsearch service ``DocumentFactoryInterface`` , so it is registered in a | ||
Compiler Pass since elasticsearch is not available directly from the bundle. | ||
|
||
To use this feature, ensure you have elasticsearch bundle added to your project. | ||
|
||
The ``DocumentFactory`` service uses all base field mapper services to index content into the correct document | ||
(content, location, or translation-dependent document):: | ||
|
||
ContentFieldMapper | ||
LocationFieldMapper | ||
ContentTranslationFieldMapper | ||
LocationTranslationFieldMapper | ||
BlockFieldMapper | ||
BlockTranslationFieldMapper | ||
|
||
These services are abstract classes containing methods ``accept()`` and ``mapFields()`` which are implemented by new | ||
field mappers as needed. | ||
|
||
To add a new field mapper, create a class that extends one of the base field mappers above, implements its methods, and | ||
registers the service with one of the following tags, depending on the base field mapper:: | ||
|
||
netgen.ibexa_search_extra.elasticsearch.field_mapper.content | ||
netgen.ibexa_search_extra.elasticsearch.field_mapper.location | ||
netgen.ibexa_search_extra.elasticsearch.field_mapper.content_translation | ||
netgen.ibexa_search_extra.elasticsearch.field_mapper.location_translation | ||
netgen.ibexa_search_extra.elasticsearch.field_mapper.block_translation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters