FoldedResultList (Insight Engine)
FoldedResultList (Insight Engine)
|
|
Note
This component was introduced in version |
The FoldedResultList headless controller re-organizes results into hierarchical collections (a.k.a. threads).
Methods
fetchMoreResults
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.
findResultByCollection
Finds a folded result by its collection.
Parameters
-
collection:
FoldedCollectionThe folded collection whose collection name will be used to find a collection in the results.
Returns FoldedResult | null: The FoldedResult associated with the collection’s name.
findResultById
Finds a folded result by its unique ID.
Parameters
-
collection:
FoldedCollectionThe folded collection whose ID will be used to find a collection in the results.
Returns FoldedResult | null: The FoldedResult associated with the collection’s ID.
loadCollection
Loads all the folded results for a given collection.
Parameters
-
collection:
FoldedCollectionThe collection for which to load more results.
logShowLessFoldedResults
Logs a custom event when a user shows less folded results.
logShowMoreFoldedResults
Logs a click event when a user loads/shows more folded results.
Parameters
-
result:
ResultThe result to send analytics for.
subscribe
Adds a callback that’s invoked on state change.
Parameters
-
listener:
() => voidA callback that’s invoked on state change.
Returns Unsubscribe: A function to remove the listener.
Attributes
state
The state of the FoldedResultList controller.
Properties
-
moreResultsAvailable:
booleanWhether more results are available, using the same parameters as the last successful query.
This property is not compatible with the
Pagercontroller. -
results:
FoldedCollection[]The ordered list of collections.
-
searchResponseId:
stringThe unique identifier of the response where the results were fetched, this value does not change when loading more results.
-
firstSearchExecuted:
booleanDetermines if a first search has been executed.
-
hasError:
booleantrueif there is an error for the last executed query andfalseotherwise. -
hasResults:
booleanDetermines if there are results available for the last executed query.
-
isLoading:
booleanDetermines if a search is in progress.
Initialize
buildFoldedResultList
Creates a FoldedResultList controller instance.
Parameters
-
engine:
InsightEngineThe headless engine.
-
props:
InsightFoldedResultListPropsThe configurable
FoldedResultListproperties.
Returns FoldedResultList
InsightFoldedResultListProps
The configurable FoldedResultList properties.
Properties
-
options?:
FoldedResultListOptionsThe options for the
FoldedResultListcontroller.
FoldedResultListOptions
The options for the FoldedResultList controller.
Properties
-
folding?:
FoldingOptions -
fieldsToInclude?:
string[]A list of indexed fields to include in the objects returned by the result list. These results are included in addition to the default fields. If this is left empty only the default fields are included.
Related types
FoldedCollection
Properties
-
isLoadingMoreResults:
booleanWhether there is an ongoing query to add more results to the collection.
-
moreResultsAvailable:
booleanWhether more results might be available in the collection.
-
children:
FoldedResult[]The children of this result sorted in the same order as the search results.
-
result:
ResultThe result at this position in the collection.
FoldedResult
Properties
-
children:
FoldedResult[]The children of this result sorted in the same order as the search results.
-
result:
ResultThe result at this position in the collection.
FoldedResult | null
Properties
-
children:
FoldedResult[]The children of this result sorted in the same order as the search results.
-
result:
ResultThe result at this position in the collection.
FoldingOptions
Properties
-
childField?:
stringThe name of the field that uniquely identifies a result within a collection.
Default:
foldingchild -
collectionField?:
stringThe name of the field on which to do the folding. The folded result list component will use the values of this field to resolve the collections of result items.
Default:
foldingcollection -
numberOfFoldedResults?:
numberThe number of child results to fold under the root collection element, before expansion.
Default:
2 -
parentField?:
stringThe name of the field that determines whether a certain result is a top result containing other child results within a collection.
Default:
foldingparent
HighlightKeyword
Properties
-
length:
numberThe length of the offset.
-
offset:
numberThe 0 based offset inside the string where the highlight should start.
Raw
Properties
-
[key: string]:
unknownCustom keys that depend on the documents in the index.
Result
Properties
-
absentTerms:
string[]The basic query expression terms which this query result item does not match. Note: This property is populated by terms from the query pipeline-processed q value (not from the original q value).
-
clickUri:
stringThe hyperlinkable item URI. Notes: Use the clickUri value when you want to create hyperlinks to the item, rather than the uri or printableUri value.
-
excerpt:
stringThe contextual excerpt generated for the item (see the excerptLength query parameter).
-
excerptHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item excerpt string.
-
firstSentences:
stringThe first sentences retrieved from the item (see the retrieveFirstSentences query parameter).
-
firstSentencesHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item firstSentences string.
-
flags:
stringThe flags that are set on the item by the index. Distinct values are separated by semicolons.
-
hasHtmlVersion:
booleanWhether the index contains an HTML version of this item.
-
isRecommendation:
booleanWhether the item score was boosted as a Coveo ML recommendation.
-
isTopResult:
booleanWhether the item score was boosted by a featured result rule in the query pipeline.
-
isUserActionView:
booleanWhether the result item has been previously viewed by one of the users specified in the
canSeeUserProfileOfsection of the search token generated to perform the search request. -
percentScore:
numberThe item ranking score expressed as a percentage (see the sortCriteria and rankingFunctions query parameters).
-
printableUri:
stringThe human readable item URI. Note: Avoid using the printableUri value to create hyperlinks to the item. Use the clickUri value instead.
-
printableUriHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item printableUri string.
-
rankingInfo:
string | nullThe raw debug information generated by the index to detail how the item was ranked. This property is null unless the debug query parameter is set to true.
-
raw:
RawThe values of the fields which were retrieved for this item (see the fieldsToInclude and fieldsToExclude query parameters).
-
score:
numberThe total ranking score computed for the item (see the sortCriteria and rankingFunctions query parameters).
-
searchUid:
stringThe unique identifier of the search that returned this result.
-
summary:
nullThe item summary (see the summaryLength query parameter).
-
summaryHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item summary string.
-
title:
stringContains the title of the item.
-
titleHighlights:
HighlightKeyword[]The length and offset of each word to highlight in the item title string.
-
uniqueId:
stringThe unique item identifier. You should consider the uniqueId value as an opaque string.
-
uri:
stringThe item URI. Notes: Avoid using the uri value to create hyperlinks to the item. Use the clickUri value instead.
-
rankingModifier?:
stringIf applicable, represents the type of ranking modification that was applied to this result.
Unsubscribe
Call signatures
-
(): void;