Why are some child items not folded?

This is for:

Developer
In this article

This page assumes you have followed the appropriate steps to implement result folding on your page (see Folding results).

One important thing to remember about result folding is that the index won’t necessarily fold all of the child items that belong to a parent-child relationship. Only child items that are already present in the current result set will be folded. In other words, the Folding and FoldingForThread components won’t automatically expand the query to retrieve all child items.

The range value you specify in the Folding component represents the maximum number of child items the index tries to fold per parent-child relationship.

A parent-child relationship must always have a parent, regardless of whether this parent is part of the current query result set or not.

When a Folding component is present in a search interface, the index proceeds as follows to fold query results:

  1. For each parent-child relationship in the current query result set:

    1. Find the parent.

    2. While the number of folded child items is less than the range value

      1. Try to find an additional child item, first in the current result set, then in the rest of the indexed items.

      2. If a child item is found, fold it.

Suppose you enable result folding in your search page and set the range value to 6 (see Enabling result folding).

A user sends a query that returns a set of 25 results. Five of those results are email results that belong to the same parent-child relationship (an email conversation).

Let’s assume that the parent item is in the query result set (in this case, the parent item is probably the oldest email result). This means that the remaining four results that belong to the email conversation are child items (email replies) in this email conversation. The index folds those four results under the parent item. Since the range value is 6, the index can still fold two additional child items.

Suppose the original email conversation includes four additional replies. The index folds the first two additional child items it finds (the two most relevant replies that aren’t in the current result set). However, the index doesn’t fold the remaining two child items, since the range value doesn’t allow it to fold any more child items.

In conclusion, the index folds up to a certain number of child items from those it deems most relevant to the current query.

The index uses the sortCriteria of the current query to determine the order in which to fold the results.

If the current sortCriteria is date descending, the index folds the most recent replies of an email conversation first under their parent.

You can easily override this by specifying a value for the rearrange option of the Folding component.