The hook will initially return undefined while the data loads from our API. Once it has loaded, your component will re-render and the hook will return an array containing message objects including thread location.
Please note that the results are limited to 50 messages by default, but you can use the limit option to override that. To get more specific results, consider using one or more of the other search options provided.
Set locationOptions.location to a specific thread location to search. If locationOptions.partialMatch is true, we perform partial matching on the specified location. If false, we fetch information only from the specified location.
Sort the messages returned based on either their creation timestamp or relevance. Relevance refers to how closely the provided textToMatch string matches the content of the messages. Combine this with sortDirection to fine-tune the sorting order.
By default, sorting is performed by relevance if textToMatch is provided, but will fallback to created_timestamp if it's not.
Property to control the order in which the messages returned are sorted. Using sortBy value of relevance and sortDirection of descending are the best options for getting the most relevant results at the top and is the default sorting criteria.