# AppSearchSchema.LongPropertyConfig.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

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

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

## Summary

|                                                                                                                                                                                                   Public constructors                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#Builder(kotlin.String))`(`propertyName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a new[LongPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#). |

|                                                                                                                                                                                                                                                   Public methods                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AppSearchSchema.LongPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig)                  | [build](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#build())`()` Constructs a new[LongPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig)from the contents of this builder.                               |
| [AppSearchSchema.LongPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#) | [setCardinality](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#setCardinality(kotlin.Int))`(`cardinality:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the cardinality of the property (whether it is optional, required or repeated).   |
| [AppSearchSchema.LongPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#) | [setDescription](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#setDescription(kotlin.String))`(`description:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets a natural language description of this property.                         |
| [AppSearchSchema.LongPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#) | [setIndexingType](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#setIndexingType(kotlin.Int))`(`indexingType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Configures how a property should be indexed so that it can be retrieved by queries. |
| [AppSearchSchema.LongPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#) | [setScoringEnabled](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#setScoringEnabled(kotlin.Boolean))`(`scoringEnabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets the property enabled or disabled for scoring.                |

## Public constructors

### Builder

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

```
Builder(propertyName: String)
```

Creates a new[LongPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig.Builder#).

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

## Public methods

### build

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

```
fun build(): AppSearchSchema.LongPropertyConfig
```

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

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

### setCardinality

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

```
fun setCardinality(cardinality: Int): AppSearchSchema.LongPropertyConfig.Builder
```

Sets the cardinality of the property (whether it is optional, required or repeated).

If this method is not called, the default cardinality is[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL:kotlin.Int).

|                                                                                                                                                                                                                                                                                                                                                                       Parameters                                                                                                                                                                                                                                                                                                                                                                        ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cardinality` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED:kotlin.Int),[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL:kotlin.Int), or[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED:kotlin.Int) |

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

### setDescription

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

```
fun setDescription(description: String): AppSearchSchema.LongPropertyConfig.Builder
```

Sets a natural language description of this property.

For more details about the description field, see[android.app.appsearch.AppSearchSchema.PropertyConfig#getDescription](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#getDescription()).

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

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

### setIndexingType

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 setIndexingType(indexingType: Int): AppSearchSchema.LongPropertyConfig.Builder
```

Configures how a property should be indexed so that it can be retrieved by queries.

If this method is not called, the default indexing type is[android.app.appsearch.AppSearchSchema.LongPropertyConfig#INDEXING_TYPE_NONE](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig#INDEXING_TYPE_NONE:kotlin.Int), so that it will not be indexed and cannot be matched by queries.

|                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                     ||
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `indexingType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.appsearch.AppSearchSchema.LongPropertyConfig#INDEXING_TYPE_NONE](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig#INDEXING_TYPE_NONE:kotlin.Int), or[android.app.appsearch.AppSearchSchema.LongPropertyConfig#INDEXING_TYPE_RANGE](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.LongPropertyConfig#INDEXING_TYPE_RANGE:kotlin.Int) |

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

### setScoringEnabled

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

```
fun setScoringEnabled(scoringEnabled: Boolean): AppSearchSchema.LongPropertyConfig.Builder
```

Sets the property enabled or disabled for scoring.

If this method is not called, the default value is false.

If enabled, it can be used in the advanced ranking expression via the function of 'getScorableProperty'.

For the detailed documentation, see[android.app.appsearch.SearchSpec.Builder#setRankingStrategy(java.lang.String)](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec.Builder#setRankingStrategy(kotlin.String)).

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