---
schema_version: "1"
id: bf9c967ab57a3e506e9e236335828393e1b94159c15f476451cc9bc5b36187e3
title: QuestionSuggestionFilter Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Search_QuestionSuggestionFilter.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 883f83fd8f6618cf0d1dc3bf8f665cda23f276b28f76180672df49852eb3e806
description: The Search.QuestionSuggestionFilter class filters results from a call to System.Search.suggest(searchQuery, sObjectType, options) when the SOSL searchQuery contains a FeedItem object.Adds a filter to display questions associated with the single specified group whose ID is passed in as an argument. This filter is optional.Adds a filter to display questions associated with the single specified network whose ID is passed in as an argument. This filter is optional.Adds a filter to display questions belonging to the single specified user whose ID is passed in as an argument. This filter is optional.Sets a new list of groups to replace the current list of groups where the group IDs are passed in as an argument. This filter is optional.Sets a new list of networks to replace the current list of networks where the network IDs are passed in as an argument. This filter is optional.Sets a filter to display questions associated with the single specified topic whose ID is passed in as an argument. This filter is optional.Sets a new list of users to replace the current list of users where the users IDs are passed in as an argument. This filter is optional.
---
# QuestionSuggestionFilter Class

The Search.QuestionSuggestionFilter class filters results from a call to System.Search.suggest(searchQuery, sObjectType, options) when the SOSL searchQuery contains a FeedItem object.

## Namespace

[Search](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Search.htm#apex_namespace_Search "The Search namespace provides classes for getting search results and suggestion results.")

- **[QuestionSuggestionFilter Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_methods)**

## QuestionSuggestionFilter Methods

The following are methods for QuestionSuggestionFilter.

- **[addGroupId(groupId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_addGroupId)**  
    Adds a filter to display questions associated with the single specified group whose ID is passed in as an argument. This filter is optional.
- **[addNetworkId(networkId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_addNetworkId)**  
    Adds a filter to display questions associated with the single specified network whose ID is passed in as an argument. This filter is optional.
- **[addUserId(userId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_addUserId)**  
    Adds a filter to display questions belonging to the single specified user whose ID is passed in as an argument. This filter is optional.
- **[setGroupIds(groupIds)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_setGroupIds)**  
    Sets a new list of groups to replace the current list of groups where the group IDs are passed in as an argument. This filter is optional.
- **[setNetworkIds(networkIds)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_setNetworkIds)**  
    Sets a new list of networks to replace the current list of networks where the network IDs are passed in as an argument. This filter is optional.
- **[setTopicId(topicId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_setTopicId)**  
    Sets a filter to display questions associated with the single specified topic whose ID is passed in as an argument. This filter is optional.
- **[setUserIds(userIds)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_QuestionSuggestionFilter.htm#apex_Search_QuestionSuggestionFilter_setUserIds)**  
    Sets a new list of users to replace the current list of users where the users IDs are passed in as an argument. This filter is optional.

### addGroupId(groupId)

Adds a filter to display questions associated with the single specified group whose ID is passed in as an argument. This filter is optional.

#### Signature

public void addGroupId(String groupId)

#### Parameters

- **groupId**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The ID for a group.

#### Return Value

Type: void

#### Usage

To add more than one group, call the method multiple times.

### addNetworkId(networkId)

Adds a filter to display questions associated with the single specified network whose ID is passed in as an argument. This filter is optional.

#### Signature

public void addNetworkId(String networkId)

#### Parameters

- **networkId**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The ID of the Experience Cloud site about which you’re retrieving this information.

#### Return Value

Type: void

#### Usage

To add more than one network, call the method multiple times.

### addUserId(userId)

Adds a filter to display questions belonging to the single specified user whose ID is passed in as an argument. This filter is optional.

#### Signature

public void addUserId(String userId)

#### Parameters

- **userId**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The ID for the user.

#### Return Value

Type: void

#### Usage

To add more than one user, call the method multiple times.

### setGroupIds(groupIds)

Sets a new list of groups to replace the current list of groups where the group IDs are passed in as an argument. This filter is optional.

#### Signature

public void setGroupIds(List<String\> groupIds)

#### Parameters

- **groupIds**: Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")\> A list of group IDs.

#### Return Value

Type: void

### setNetworkIds(networkIds)

Sets a new list of networks to replace the current list of networks where the network IDs are passed in as an argument. This filter is optional.

#### Signature

public void setNetworkIds(List<String\> networkIds)

#### Parameters

- **networkIds**: Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")\> A list of network IDs.

#### Return Value

Type: void

### setTopicId(topicId)

Sets a filter to display questions associated with the single specified topic whose ID is passed in as an argument. This filter is optional.

#### Signature

public void setTopicId(String topicId)

#### Parameters

- **topicId**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The ID for a topic.

#### Return Value

Type: void

### setUserIds(userIds)

Sets a new list of users to replace the current list of users where the users IDs are passed in as an argument. This filter is optional.

#### Signature

public void setUserIds(List<String\> userIds)

#### Parameters

- **userIds**: Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")\> A list of user IDs.

#### Return Value

Type: void