# Fts3

Artifact: [androidx.room3:room3-common](https://developer.android.com/jetpack/androidx/releases/room3) [View Source](https://cs.android.com/search?q=file:androidx/room3/Fts3.kt+class:androidx.room3.Fts3) Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  @Target(allowedTargets = [AnnotationTarget.CLASS])
  @Retention(value = AnnotationRetention.BINARY)
  annotation Fts3
  ```

*** ** * ** ***

Marks an `https://developer.android.com/reference/kotlin/androidx/room3/Entity` annotated class as a FTS3 entity. This class will have a mapping SQLite FTS3 table in the database.

[FTS3 and FTS4](https://www.sqlite.org/fts3.html) are SQLite virtual table modules that allows full-text searches to be performed on a set of documents.

An FTS entity table always has a column named `rowid` that is the equivalent of an `INTEGER PRIMARY KEY`. Therefore, an FTS entity can only have a single property annotated with `https://developer.android.com/reference/kotlin/androidx/room3/PrimaryKey`, it must be named `rowid` and must be of `INTEGER` affinity. The property can be optionally omitted in the class but can still be used in queries.

All properties in an FTS entity are of `TEXT` affinity, except the for the 'rowid' property.

Example:

```kotlin
@Entity
@Fts3
data class Mail (
  @PrimaryKey
  @ColumnInfo(name = "rowid")
  val rowId: Int,
  val subject: String,
  val body: String
)
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/Entity` |   |
| `https://developer.android.com/reference/kotlin/androidx/room3/Dao` |   |
| `https://developer.android.com/reference/kotlin/androidx/room3/Database` |   |
| `https://developer.android.com/reference/kotlin/androidx/room3/PrimaryKey` |   |
| `https://developer.android.com/reference/kotlin/androidx/room3/ColumnInfo` |   |

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/Fts3#Fts3(kotlin.String,kotlin.Array)(tokenizer: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, tokenizerArgs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>)` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/room3/Fts3#tokenizer()` The tokenizer to be used in the FTS table. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/kotlin/androidx/room3/Fts3#tokenizerArgs()` Optional arguments to configure the defined tokenizer. | Cmn |

## Public constructors

### Fts3

Cmn Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/room3#3.0.0)

```
Fts3(tokenizer: String = TOKENIZER_SIMPLE, tokenizerArgs: Array<String> = [])
```

## Public properties

### tokenizer

Cmn

```
val tokenizer: String
```

The tokenizer to be used in the FTS table.

The default value is `https://developer.android.com/reference/kotlin/androidx/room3/FtsOptions#TOKENIZER_SIMPLE()`. Tokenizer arguments can be defined with `https://developer.android.com/reference/kotlin/androidx/room3/Fts3#(kotlin.String,kotlin.Array)`.

If a custom tokenizer is used, the tokenizer and its arguments are not verified at compile time.

See [SQLite tokenizers documentation](https://www.sqlite.org/fts3.html#tokenizer) for more details.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The tokenizer to use on the FTS table. Built-in available tokenizers are `https://developer.android.com/reference/kotlin/androidx/room3/FtsOptions#TOKENIZER_SIMPLE()`, `https://developer.android.com/reference/kotlin/androidx/room3/FtsOptions#TOKENIZER_PORTER()` and `https://developer.android.com/reference/kotlin/androidx/room3/FtsOptions#TOKENIZER_UNICODE61()`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/room3/Fts3#(kotlin.String,kotlin.Array)` |   |

### tokenizerArgs

Cmn

```
val tokenizerArgs: Array<String>
```

Optional arguments to configure the defined tokenizer.

Tokenizer arguments consist of an argument name, followed by an "=" character, followed by the option value. For example, `separators=.` defines the dot character as an additional separator when using the `https://developer.android.com/reference/kotlin/androidx/room3/FtsOptions#TOKENIZER_UNICODE61()` tokenizer.

The available arguments that can be defined depend on the tokenizer defined, see the [SQLite tokenizers documentation](https://www.sqlite.org/fts3.html#tokenizer) for details.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>` | A list of tokenizer arguments strings. |