Skip to content

Commit

Permalink
NGSTACK-836 documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Katarina Miočić committed Aug 2, 2024
1 parent 113a696 commit 9014f2e
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions docs/reference/descendant_indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Descendant indexing
=====================

This feature helps in indexing hierarchical content structures. It allows the children of a content item to be indexed
within the same document as the parent if both are configured for descendant indexing.
within the same document as the parent if both are configured for descendant indexing. This means that when you search
for a child content, the parent content will also appear in the search results.

''Configuration''

Expand All @@ -23,6 +24,8 @@ To enable this feature, set up the descendant indexing configuration:
The ``enabled`` field must be set to true to activate descendant indexing services by registering them in the container.
In the array parameter ``map`` we define the structure of content to be included in descendant indexing by content types.
The first content type identifier represents the parent content, which will hold the indexed children content document,
and the rest represent the structure under it and whether it will be indexed or not.
Any structure in the content tree that matches the configuration will be part of descendant indexing. Content can be
part of the structure but not included in the index. To index the content in the parent document, set the ``indexed```
parameter to ``true``.
Expand Down Expand Up @@ -55,17 +58,5 @@ identifier defined in the configuration.
return 'ng_descendant_indexing_fulltext';
}
''AncestorIndexer''

AncestorIndexer is a service that ensures descendant indexing is considered during reindexing. For example, if we edit
content that is part of the descendant indexing map, the descendant content in which it is indexed should also be
reindexed.

The service contains methods ``indexSingle()`` and ``indexMultiple()``, which are called in handlers for any content
changes (e.g., ``CopyContentHandler``, ``DeleteContentHandler``). These methods use the AncestorResolver service to
resolve the ancestor to be reindexed. If no ancestor matches the configuration map structure, the ``resolveAncestor()``
method returns null.

The AncestorResolver service uses AncestorPathGenerator service to read from the configuration and return an array of
strings representing all of the paths matching the given configuration in order to be able to find a match with any of
the paths.
The BaseFieldMapper is implemented only for Solr indexing engine and the field mappers are plugged into the existing
solr indexing system.

0 comments on commit 9014f2e

Please sign in to comment.