@coveo/headless-react
    Preparing search index...

    Interface FoldedResultList

    The FoldedResultList headless controller re-organizes results into hierarchical collections (a.k.a. threads).

    Example: folded-result-list.fn.tsx

    interface FoldedResultList {
        state: FoldedResultListState;
        fetchMoreResults(): void;
        findResultByCollection(collection: FoldedCollection): null | FoldedResult;
        findResultById(collection: FoldedCollection): null | FoldedResult;
        loadCollection(collection: FoldedCollection): void;
        logShowLessFoldedResults(): void;
        logShowMoreFoldedResults(result: Result): void;
        subscribe(listener: () => void): Unsubscribe;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Using the same parameters as the last successful query, fetch another batch of results, if available. Particularly useful for infinite scrolling, for example.

      This method is not compatible with the Pager controller.

      Returns void

    • Finds a folded result by its collection.

      Parameters

      • collection: FoldedCollection

        The folded collection whose collection name will be used to find a collection in the results.

      Returns null | FoldedResult

      The FoldedResult associated with the collection's name.

    • Finds a folded result by its unique ID.

      Parameters

      • collection: FoldedCollection

        The folded collection whose ID will be used to find a collection in the results.

      Returns null | FoldedResult

      The FoldedResult associated with the collection's ID.

    • Loads all the folded results for a given collection.

      Parameters

      Returns void

    • Logs a custom event when a user shows less folded results.

      Returns void

    • Logs a click event when a user loads/shows more folded results.

      Parameters

      • result: Result

        The result to send analytics for.

      Returns void

    • Adds a callback that's invoked on state change.

      Parameters

      • listener: () => void

        A callback that's invoked on state change.

      Returns Unsubscribe

      A function to remove the listener.

    Properties

    The state of the FoldedResultList controller.