# 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 />

```
public final class SearchSuggestionSpec.Builder
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentClasses(java.lang.Class<?>...)(@https://developer.android.com/reference/androidx/annotation/NonNull Class[] documentClasses)` Adds a schema filter to `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentClasses(java.util.Collection<? extends java.lang.Class<?>>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> documentClasses )` Adds the Schema names of given document classes to the Schema type filter of `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentIds(java.lang.String,java.lang.String...)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html namespace, @https://developer.android.com/reference/androidx/annotation/NonNull String[] documentIds )` Adds a document ID filter to `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterDocumentIds(java.lang.String,java.util.Collection<java.lang.String>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html namespace, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> documentIds )` Adds a document ID filter to `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterNamespaces(java.lang.String...)(@https://developer.android.com/reference/androidx/annotation/NonNull String[] namespaces)` Adds a namespace filter to `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterNamespaces(java.util.Collection<java.lang.String>)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> namespaces)` Adds a namespace filter to `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterProperties(java.lang.Class<?>,java.util.Collection<java.lang.String>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> documentClass, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> propertyPaths )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterProperties(java.lang.String,java.util.Collection<java.lang.String>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html schema, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> propertyPaths )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterPropertyPaths(java.lang.Class<?>,java.util.Collection<androidx.appsearch.app.PropertyPath>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> documentClass, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath> propertyPaths )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.SEARCH_SPEC_ADD_FILTER_PROPERTIES) https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterPropertyPaths(java.lang.String,java.util.Collection<androidx.appsearch.app.PropertyPath>)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html schema, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath> propertyPaths )` Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterSchemas(java.lang.String...)(@https://developer.android.com/reference/androidx/annotation/NonNull String[] schemaTypes)` Adds a schema filter to `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addFilterSchemas(java.util.Collection<java.lang.String>)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> schemaTypes)` Adds a schema filter to `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` Entry. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.SEARCH_SPEC_SEARCH_STRING_PARAMETERS) https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addSearchStringParameters(java.lang.String...)(@https://developer.android.com/reference/androidx/annotation/NonNull String[] searchStringParameters)` 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/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `@https://developer.android.com/reference/androidx/annotation/RequiresFeature(enforcement = "androidx.appsearch.app.Features#isFeatureSupported", name = https://developer.android.com/reference/androidx/appsearch/app/Features.SEARCH_SPEC_SEARCH_STRING_PARAMETERS) https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#addSearchStringParameters(java.util.List<java.lang.String>)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> searchStringParameters)` 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/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#build()()` Constructs a new `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec` from the contents of this builder. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder` | `https://developer.android.com/reference/androidx/appsearch/app/SearchSuggestionSpec.Builder#setRankingStrategy(int)(int rankingStrategy)` 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)

```
public Builder(@IntRange(from = 1) int maximumResultCount)
```

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

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

## Public methods

### addFilterDocumentClasses

```
public @NonNull SearchSuggestionSpec.Builder addFilterDocumentClasses(@NonNull Class[] documentClasses)
```

Adds a schema filter to `https://developer.android.com/reference/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/androidx/appsearch/app/SearchSuggestionSpec#getFilterSchemas()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull Class[] documentClasses` | classes annotated with `https://developer.android.com/reference/androidx/appsearch/annotation/Document`. |

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

### addFilterDocumentClasses

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

```
public @NonNull SearchSuggestionSpec.Builder addFilterDocumentClasses(
    @NonNull Collection<Class<@NonNull ?>> documentClasses
)
```

Adds the Schema names of given document classes to the Schema type filter of `https://developer.android.com/reference/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/androidx/appsearch/app/SearchSuggestionSpec#getFilterSchemas()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> documentClasses` | classes annotated with `https://developer.android.com/reference/androidx/appsearch/annotation/Document`. |

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

### addFilterDocumentIds

```
public @NonNull SearchSuggestionSpec.Builder addFilterDocumentIds(
    @NonNull String namespace,
    @NonNull String[] documentIds
)
```

Adds a document ID filter to `https://developer.android.com/reference/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)

```
public @NonNull SearchSuggestionSpec.Builder addFilterDocumentIds(
    @NonNull String namespace,
    @NonNull Collection<String> documentIds
)
```

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

If unset, the query will search over all documents.

### addFilterNamespaces

```
public @NonNull SearchSuggestionSpec.Builder addFilterNamespaces(@NonNull String[] namespaces)
```

Adds a namespace filter to `https://developer.android.com/reference/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)

```
public @NonNull SearchSuggestionSpec.Builder addFilterNamespaces(@NonNull Collection<String> namespaces)
```

Adds a namespace filter to `https://developer.android.com/reference/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)
public @NonNull SearchSuggestionSpec.Builder addFilterProperties(
    @NonNull Class<@NonNull ?> documentClass,
    @NonNull Collection<String> propertyPaths
)
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> documentClass` | class annotated with `https://developer.android.com/reference/androidx/appsearch/annotation/Document`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> propertyPaths` | The String version of `https://developer.android.com/reference/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/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)
public @NonNull SearchSuggestionSpec.Builder addFilterProperties(
    @NonNull String schema,
    @NonNull Collection<String> propertyPaths
)
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html schema` | the `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSchema` that contains the target properties |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> propertyPaths` | The String version of `https://developer.android.com/reference/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)
public @NonNull SearchSuggestionSpec.Builder addFilterPropertyPaths(
    @NonNull Class<@NonNull ?> documentClass,
    @NonNull Collection<PropertyPath> propertyPaths
)
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> documentClass` | class annotated with `https://developer.android.com/reference/androidx/appsearch/annotation/Document`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath> propertyPaths` | The `https://developer.android.com/reference/androidx/appsearch/app/PropertyPath` to search suggestion over |

| Throws |
|---|---|
| `https://developer.android.com/reference/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)
public @NonNull SearchSuggestionSpec.Builder addFilterPropertyPaths(
    @NonNull String schema,
    @NonNull Collection<PropertyPath> propertyPaths
)
```

Adds property paths for the specified type to the property filter of `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html schema` | the `https://developer.android.com/reference/androidx/appsearch/app/AppSearchSchema` that contains the target properties |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/androidx/appsearch/app/PropertyPath> propertyPaths` | The `https://developer.android.com/reference/androidx/appsearch/app/PropertyPath` to search suggestion over |

### addFilterSchemas

```
public @NonNull SearchSuggestionSpec.Builder addFilterSchemas(@NonNull String[] schemaTypes)
```

Adds a schema filter to `https://developer.android.com/reference/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)

```
public @NonNull SearchSuggestionSpec.Builder addFilterSchemas(@NonNull Collection<String> schemaTypes)
```

Adds a schema filter to `https://developer.android.com/reference/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)
public @NonNull SearchSuggestionSpec.Builder addSearchStringParameters(@NonNull String[] searchStringParameters)
```

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/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)
public @NonNull SearchSuggestionSpec.Builder addSearchStringParameters(@NonNull List<String> searchStringParameters)
```

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/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)

```
public @NonNull SearchSuggestionSpec build()
```

Constructs a new `https://developer.android.com/reference/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)

```
public @NonNull SearchSuggestionSpec.Builder setRankingStrategy(int rankingStrategy)
```

Sets ranking strategy for suggestion results.

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