# AppSearchManager.SearchContext

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# SearchContext

*** ** * ** ***

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

```
class SearchContext
```

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

Contains information about how to create the search session.

## Summary

|                                                                                                                           Nested classes                                                                                                                           ||
|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchManager.SearchContext.Builder) Builder for[SearchContext](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchManager.SearchContext#)objects. |

|                                                                                                                                   Public methods                                                                                                                                   ||
|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getDatabaseName](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchManager.SearchContext#getDatabaseName())`()` Returns the name of the database to create or open. |

## Public methods

### getDatabaseName

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getDatabaseName(): String
```

Returns the name of the database to create or open.

Databases with different names are fully separate with distinct types, namespaces, and data.

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