SuggestionOption Class

Options that narrow record and article suggestion results returned from a call to System.Search.suggest(String, String, Search.SuggestionOption).

Search

The following are methods for SuggestionOption.

  • setFilter(knowledgeSuggestionFilter)

    Set filters that narrow Salesforce Knowledge article results in a call to System.Search.suggest(String, String, Search.SuggestionOption).

  • setLimit(limit)

    The maximum number of record or article suggestions to retrieve.

Set filters that narrow Salesforce Knowledge article results in a call to System.Search.suggest(String, String, Search.SuggestionOption).

public void setFilter(Search.KnowledegeSuggestionFilter knowledgeSuggestionFilter)

Type: void

The maximum number of record or article suggestions to retrieve.

public void setLimit(Integer limit)

  • limit: Type: Integer The maximum number of record or article suggestions to retrieve.

Type: void

By default, the System.Search.suggest(String, String, Search.SuggestionOption) method returns the 5 most relevant results. However, if your query is broad, it could match more than 5 results. If Search.SuggestionResults.hasMoreResults() returns true, there are more than 5 results. To retrieve them, call setLimit(Integer) to increase the number of suggestions results.