# SearchSuggestionSpec.Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/app/appsearch/SearchSuggestionSpec.Builder "View this page in Java")  

```
class Builder
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                           ||
| ↳ | [android.app.appsearch.SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) |

Builder for[objects](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec).

## Summary

|                                                                                                                                                                                      Public constructors                                                                                                                                                                                      ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#Builder(kotlin.Int))`(`maximumResultCount:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates an[SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#)object. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                    Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterDocumentIds](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterDocumentIds(kotlin.String,%20kotlin.String))`(`namespace:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `vararg` `documentIds:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Adds a document ID filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry.                                                                                                                                                                                                |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterDocumentIds](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterDocumentIds(kotlin.String,%20kotlin.collections.MutableCollection))`(`namespace:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `documentIds:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Adds a document ID filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry.                                                             |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterNamespaces](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterNamespaces(kotlin.String))`(`vararg` `namespaces:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Adds a namespace filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry.                                                                                                                                                                                                                                                                                                                       |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterNamespaces](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterNamespaces(kotlin.collections.MutableCollection))`(`namespaces:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Adds a namespace filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry.                                                                                                                                                                                    |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterProperties](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterProperties(kotlin.String,%20kotlin.collections.MutableCollection))`(`schema:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `propertyPaths:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Adds property paths for the specified type to the property filter of[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry.                        |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterPropertyPaths](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterPropertyPaths(kotlin.String,%20kotlin.collections.MutableCollection))`(`schema:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `propertyPaths:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[PropertyPath](https://developer.android.com/reference/kotlin/android/app/appsearch/PropertyPath)!>`)` Adds property paths for the specified type to the property filter of[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterSchemas](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterSchemas(kotlin.String))`(`vararg` `schemaTypes:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Adds a schema filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry.                                                                                                                                                                                                                                                                                                                               |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addFilterSchemas](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addFilterSchemas(kotlin.collections.MutableCollection))`(`schemaTypes:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Adds a schema filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry.                                                                                                                                                                                            |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addSearchStringParameters](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addSearchStringParameters(kotlin.String))`(`vararg` `searchStringParameters:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Adds Strings to the list of String parameters that can be referenced in the query through the "getSearchStringParameter({index})" function.                                                                                                                                                                                                                                                                                                     |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [addSearchStringParameters](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#addSearchStringParameters(kotlin.collections.MutableList))`(`searchStringParameters:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Adds Strings to the list of String parameters that can be referenced in the query through the "getSearchStringParameter({index})" function.                                                                                                                                                                                    |
| [SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)                  | [build](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#build())`()` Constructs a new[SearchSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec)from the contents of this builder.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | [setRankingStrategy](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#setRankingStrategy(kotlin.Int))`(`rankingStrategy:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets ranking strategy for suggestion results.                                                                                                                                                                                                                                                                                                                                                                                                                                           |

## Public constructors

### Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
Builder(maximumResultCount: Int)
```

Creates an[SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#)object.

|                                                                                      Parameters                                                                                      ||
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `maximumResultCount` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Sets the maximum number of suggestion in the returned object. Value is 1 or greater |

## Public methods

### addFilterDocumentIds

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun addFilterDocumentIds(
    namespace: String, 
    vararg documentIds: String!
): SearchSuggestionSpec.Builder
```

Adds a document ID filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions in the given specified documents.

If unset, the query will search over all documents.

|                                                          Parameters                                                          ||
|---------------|---------------------------------------------------------------------------------------------------------------|
| `namespace`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`.  |
| `documentIds` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

### addFilterDocumentIds

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun addFilterDocumentIds(
    namespace: String, 
    documentIds: MutableCollection<String!>
): SearchSuggestionSpec.Builder
```

Adds a document ID filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions in the given specified documents.

If unset, the query will search over all documents.

|                                                                                                                     Parameters                                                                                                                      ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `namespace`   | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`.                                                                                                                         |
| `documentIds` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

### addFilterNamespaces

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun addFilterNamespaces(vararg namespaces: String!): SearchSuggestionSpec.Builder
```

Adds a namespace filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions that has documents under the specified namespaces.

If unset, the query will search over all namespaces.

|                                                         Parameters                                                          ||
|--------------|---------------------------------------------------------------------------------------------------------------|
| `namespaces` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

### addFilterNamespaces

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun addFilterNamespaces(namespaces: MutableCollection<String!>): SearchSuggestionSpec.Builder
```

Adds a namespace filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions that has documents under the specified namespaces.

If unset, the query will search over all namespaces.

|                                                                                                                     Parameters                                                                                                                     ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `namespaces` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

### addFilterProperties

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 13](https://developer.android.com/sdkExtensions)  

```
fun addFilterProperties(
    schema: String, 
    propertyPaths: MutableCollection<String!>
): SearchSuggestionSpec.Builder
```

Adds property paths for the specified type to the property filter of[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions that has content under the specified property. If property paths are added for a type, then only the properties referred to will be retrieved for results of that type.

If a property path that is specified isn't present in a result, it will be ignored for that result. Property paths cannot be null.

If no property paths are added for a particular type, then all properties of results of that type will be retrieved.

Example properties: 'body', 'sender.name', 'sender.emailaddress', etc.

|                                                                                                                                                                                                                                            Parameters                                                                                                                                                                                                                                            ||
|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `schema`        | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):the[AppSearchSchema](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema)that contains the target properties This value cannot be`null`.                                                                                                                                                                                                                      |
| `propertyPaths` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:The String version of[PropertyPath](https://developer.android.com/reference/kotlin/android/app/appsearch/PropertyPath). A dot-delimited sequence of property names indicating which property in the document these snippets correspond to. This value cannot be`null`. |

### addFilterPropertyPaths

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 13](https://developer.android.com/sdkExtensions)  

```
fun addFilterPropertyPaths(
    schema: String, 
    propertyPaths: MutableCollection<PropertyPath!>
): SearchSuggestionSpec.Builder
```

Adds property paths for the specified type to the property filter of[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions that has content under the specified property. If property paths are added for a type, then only the properties referred to will be retrieved for results of that type.

If a property path that is specified isn't present in a result, it will be ignored for that result. Property paths cannot be null.

If no property paths are added for a particular type, then all properties of results of that type will be retrieved.

|                                                                                                                                                                                              Parameters                                                                                                                                                                                              ||
|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `schema`        | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):the[AppSearchSchema](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema)that contains the target properties This value cannot be`null`.                                                                                                                          |
| `propertyPaths` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[PropertyPath](https://developer.android.com/reference/kotlin/android/app/appsearch/PropertyPath)!\>:The[PropertyPath](https://developer.android.com/reference/kotlin/android/app/appsearch/PropertyPath)to search suggestion over This value cannot be`null`. |

### addFilterSchemas

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun addFilterSchemas(vararg schemaTypes: String!): SearchSuggestionSpec.Builder
```

Adds a schema filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions that has documents under the specified schema.

If unset, the query will search over all schema.

|                                                          Parameters                                                          ||
|---------------|---------------------------------------------------------------------------------------------------------------|
| `schemaTypes` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

### addFilterSchemas

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun addFilterSchemas(schemaTypes: MutableCollection<String!>): SearchSuggestionSpec.Builder
```

Adds a schema filter to[SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec)Entry. Only search for suggestions that has documents under the specified schema.

If unset, the query will search over all schema.

|                                                                                                                     Parameters                                                                                                                      ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `schemaTypes` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

### addSearchStringParameters

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 16](https://developer.android.com/sdkExtensions)  

```
fun addSearchStringParameters(vararg searchStringParameters: String!): SearchSuggestionSpec.Builder
```

Adds Strings to the list of String parameters that can be referenced in the query through the "getSearchStringParameter({index})" function.

|                                                               Parameters                                                                ||
|--------------------------|---------------------------------------------------------------------------------------------------------------|
| `searchStringParameters` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

**See Also**

- [android.app.appsearch.AppSearchSession#search](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSession#search(kotlin.String,%20android.app.appsearch.SearchSpec))  

### addSearchStringParameters

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 16](https://developer.android.com/sdkExtensions)  

```
fun addSearchStringParameters(searchStringParameters: MutableList<String!>): SearchSuggestionSpec.Builder
```

Adds Strings to the list of String parameters that can be referenced in the query through the "getSearchStringParameter({index})" function.

|                                                                                                                     Parameters                                                                                                                     ||
|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `searchStringParameters` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:This value cannot be`null`. |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |

**See Also**

- [android.app.appsearch.AppSearchSession#search](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSession#search(kotlin.String,%20android.app.appsearch.SearchSpec))  

### build

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun build(): SearchSuggestionSpec
```

Constructs a new[SearchSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec)from the contents of this builder.

|                                                                     Return                                                                     ||
|-------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec) | This value cannot be`null`. |

### setRankingStrategy

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
fun setRankingStrategy(rankingStrategy: Int): SearchSuggestionSpec.Builder
```

Sets ranking strategy for suggestion results.

The default value[SUGGESTION_RANKING_STRATEGY_DOCUMENT_COUNT](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec#SUGGESTION_RANKING_STRATEGY_DOCUMENT_COUNT:kotlin.Int)will be used if this method is never called.

|                                                                                                                                                                                                                                                                                                                                                                                                   Parameters                                                                                                                                                                                                                                                                                                                                                                                                    ||
|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `rankingStrategy` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.appsearch.SearchSuggestionSpec#SUGGESTION_RANKING_STRATEGY_NONE](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec#SUGGESTION_RANKING_STRATEGY_NONE:kotlin.Int),[android.app.appsearch.SearchSuggestionSpec#SUGGESTION_RANKING_STRATEGY_DOCUMENT_COUNT](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec#SUGGESTION_RANKING_STRATEGY_DOCUMENT_COUNT:kotlin.Int), or[android.app.appsearch.SearchSuggestionSpec#SUGGESTION_RANKING_STRATEGY_TERM_FREQUENCY](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec#SUGGESTION_RANKING_STRATEGY_TERM_FREQUENCY:kotlin.Int) |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [SearchSuggestionSpec.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSuggestionSpec.Builder#) | This value cannot be`null`. |