# SearchSuggestionSpec.Builder

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/SearchSuggestionSpec.java+class:androidx.appsearch.app.SearchSuggestionSpec.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***

<br />

```
class SearchSuggestionSpec.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#Builder(int)(maximumResultCount: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates an `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` object. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentClasses(java.lang.Class<?>...)(documentClasses: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/Class.html<*>!>)` Adds a schema filter to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentClasses(java.util.Collection<? extends java.lang.Class<?>>)( documentClasses: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/java/lang/Class.html<*>!> )` Adds the Schema names of given document classes to the Schema type filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentIds(java.lang.String,java.lang.String...)(namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, documentIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Adds a document ID filter to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentIds(java.lang.String,java.util.Collection<java.lang.String>)( namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, documentIds: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!> )` Adds a document ID filter to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterNamespaces(java.lang.String...)(namespaces: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Adds a namespace filter to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterNamespaces(java.util.Collection<java.lang.String>)(namespaces: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Adds a namespace filter to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterProperties(java.lang.Class<?>,java.util.Collection<java.lang.String>)( documentClass: https://developer.android.com/reference/java/lang/Class.html<*>, propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!> )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterProperties(java.lang.String,java.util.Collection<java.lang.String>)( schema: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!> )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterPropertyPaths(java.lang.Class<?>,java.util.Collection<androidx.appsearch.app.PropertyPath>)( documentClass: https://developer.android.com/reference/java/lang/Class.html<*>, propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath!> )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterPropertyPaths(java.lang.String,java.util.Collection<androidx.appsearch.app.PropertyPath>)( schema: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath!> )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterSchemas(java.lang.String...)(schemaTypes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Adds a schema filter to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterSchemas(java.util.Collection<java.lang.String>)(schemaTypes: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Adds a schema filter to `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.SEARCH_SPEC_SEARCH_STRING_PARAMETERS) https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addSearchStringParameters(java.lang.String...)(searchStringParameters: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-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. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/kotlin/androidx/appsearch/app/Features.SEARCH_SPEC_SEARCH_STRING_PARAMETERS) https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#addSearchStringParameters(java.util.List<java.lang.String>)( searchStringParameters: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-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. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#build()()` Constructs a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSpec` from the contents of this builder. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder#setRankingStrategy(int)(rankingStrategy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets ranking strategy for suggestion results. |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
Builder(maximumResultCount: @IntRange(from = 1) Int)
```

Creates an `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec.Builder` object.

| Parameters |
|---|---|
| `maximumResultCount: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Sets the maximum number of suggestion in the returned object. |

## Public functions

### addFilterDocumentClasses

```
fun addFilterDocumentClasses(documentClasses: Array<Class<*>!>): SearchSuggestionSpec.Builder
```

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

If unset, the query will search over all schema.

Merged list available from `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec#getFilterSchemas()`.

| Parameters |
|---|---|
| `documentClasses: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/Class.html<*>!>` | classes annotated with `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/exceptions/AppSearchException` |   |

### addFilterDocumentClasses

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun addFilterDocumentClasses(
    documentClasses: (Mutable)Collection<Class<*>!>
): SearchSuggestionSpec.Builder
```

Adds the Schema names of given document classes to the Schema type filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec` Entry. Only search for suggestions that has documents under the specified schema.

If unset, the query will search over all schema.

Merged list available from `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSuggestionSpec#getFilterSchemas()`.

| Parameters |
|---|---|
| `documentClasses: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/java/lang/Class.html<*>!>` | classes annotated with `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/exceptions/AppSearchException` |   |

### addFilterDocumentIds

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

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

If unset, the query will search over all documents.

### addFilterDocumentIds

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

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

If unset, the query will search over all documents.

### addFilterNamespaces

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

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

If unset, the query will search over all namespaces.

### addFilterNamespaces

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

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

If unset, the query will search over all namespaces.

### addFilterProperties

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES)
fun addFilterProperties(
    documentClass: Class<*>,
    propertyPaths: (Mutable)Collection<String!>
): SearchSuggestionSpec.Builder
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/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 |
|---|---|
| `documentClass: https://developer.android.com/reference/java/lang/Class.html<*>` | class annotated with `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document`. |
| `propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | The String version of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath`. A `dot-delimited sequence of property names indicating which property in the document these snippets correspond to.` |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/exceptions/AppSearchException` |   |

### addFilterProperties

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES)
fun addFilterProperties(
    schema: String,
    propertyPaths: (Mutable)Collection<String!>
): SearchSuggestionSpec.Builder
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema` that contains the target properties |
| `propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | The String version of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath`. A dot-delimited sequence of property names indicating which property in the document these snippets correspond to. |

### addFilterPropertyPaths

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES)
fun addFilterPropertyPaths(
    documentClass: Class<*>,
    propertyPaths: (Mutable)Collection<PropertyPath!>
): SearchSuggestionSpec.Builder
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/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 |
|---|---|
| `documentClass: https://developer.android.com/reference/java/lang/Class.html<*>` | class annotated with `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document`. |
| `propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath!>` | The `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` to search suggestion over |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/exceptions/AppSearchException` |   |

### addFilterPropertyPaths

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES)
fun addFilterPropertyPaths(
    schema: String,
    propertyPaths: (Mutable)Collection<PropertyPath!>
): SearchSuggestionSpec.Builder
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/kotlin/androidx/appsearch/app/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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema` that contains the target properties |
| `propertyPaths: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath!>` | The `https://developer.android.com/reference/kotlin/androidx/appsearch/app/PropertyPath` to search suggestion over |

### addFilterSchemas

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

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

If unset, the query will search over all schema.

### addFilterSchemas

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

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

If unset, the query will search over all schema.

### addSearchStringParameters

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SEARCH_SPEC_SEARCH_STRING_PARAMETERS)
fun addSearchStringParameters(searchStringParameters: Array<String!>): SearchSuggestionSpec.Builder
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#search(java.lang.String,androidx.appsearch.app.SearchSpec)` |   |

### addSearchStringParameters

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = Features.SEARCH_SPEC_SEARCH_STRING_PARAMETERS)
fun addSearchStringParameters(
    searchStringParameters: (Mutable)List<String!>
): SearchSuggestionSpec.Builder
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#search(java.lang.String,androidx.appsearch.app.SearchSpec)` |   |

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

Constructs a new `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSpec` from the contents of this builder.

### setRankingStrategy

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

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

Sets ranking strategy for suggestion results.

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