# JoinSpec

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  
Summary:[Nested Classes](https://developer.android.com/reference/android/app/appsearch/JoinSpec#nestedclasses)\|[Constants](https://developer.android.com/reference/android/app/appsearch/JoinSpec#constants)\|[Inherited Constants](https://developer.android.com/reference/android/app/appsearch/JoinSpec#inhconstants)\|[Fields](https://developer.android.com/reference/android/app/appsearch/JoinSpec#lfields)\|[Methods](https://developer.android.com/reference/android/app/appsearch/JoinSpec#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/app/appsearch/JoinSpec#inhmethods)  

# JoinSpec

*** ** * ** ***

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

`
public

final

class
JoinSpec
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

|---|--------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.appsearch.JoinSpec |

<br />

*** ** * ** ***

This class represents the specifications for the joining operation in search.

Joins are only possible for matching on the qualified id of an outer document and a property value within a subquery document. In the subquery documents, these values may be referred to with a property path such as "email.recipient.id" or "entityId" or a property expression. One such property expression is "this.qualifiedId()", which refers to the document's combined package, database, namespace, and id.

Note that in order for perform the join, the property referred to by[getChildPropertyExpression()](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getChildPropertyExpression())has to be a property with[AppSearchSchema.StringPropertyConfig.getJoinableValueType()](https://developer.android.com/reference/android/app/appsearch/AppSearchSchema.StringPropertyConfig#getJoinableValueType())set to[AppSearchSchema.StringPropertyConfig.JOINABLE_VALUE_TYPE_QUALIFIED_ID](https://developer.android.com/reference/android/app/appsearch/AppSearchSchema.StringPropertyConfig#JOINABLE_VALUE_TYPE_QUALIFIED_ID). Otherwise no documents will be joined to any[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult).

Take these outer query and subquery results for example:  

    Outer result {
       id: id1
       score: 5
     }
     Subquery result 1 {
       id: id2
       score: 2
       entityId: pkg$db/ns#id1
       notes: This is some doc
     }
     Subquery result 2 {
       id: id3
       score: 3
       entityId: pkg$db/ns#id2
       notes: This is another doc
     }
     
In this example, subquery result 1 contains a property "entityId" whose value is "pkg$db/ns#id1", referring to the outer result. If you call[Builder](https://developer.android.com/reference/android/app/appsearch/JoinSpec.Builder)with "entityId", we will retrieve the value of the property "entityId" from the child document, which is "pkg$db#ns/id1". Let's say the qualified id of the outer result is "pkg$db#ns/id1". This would mean the subquery result 1 document will be matched to that parent document. This is done by adding a[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)containing the child document to the top-level parent[SearchResult.getJoinedResults()](https://developer.android.com/reference/android/app/appsearch/SearchResult#getJoinedResults()).

If[getChildPropertyExpression()](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getChildPropertyExpression())is "notes", we will check the values of the notes property in the subquery results. In subquery result 1, this values is "This is some doc", which does not equal the qualified id of the outer query result. As such, subquery result 1 will not be joined to the outer query result.

It's possible to define an advanced ranking strategy in the nested[SearchSpec](https://developer.android.com/reference/android/app/appsearch/SearchSpec)and also use[SearchSpec.RANKING_STRATEGY_JOIN_AGGREGATE_SCORE](https://developer.android.com/reference/android/app/appsearch/SearchSpec#RANKING_STRATEGY_JOIN_AGGREGATE_SCORE)in the outer[SearchSpec](https://developer.android.com/reference/android/app/appsearch/SearchSpec). In this case, the parents will be ranked based on an aggregation, such as the sum, of the signals calculated by scoring the joined documents with the advanced ranking strategy.

In terms of scoring, if[SearchSpec.RANKING_STRATEGY_JOIN_AGGREGATE_SCORE](https://developer.android.com/reference/android/app/appsearch/SearchSpec#RANKING_STRATEGY_JOIN_AGGREGATE_SCORE)is set in[SearchSpec.getRankingStrategy](https://developer.android.com/reference/android/app/appsearch/SearchSpec#getRankingStrategy()), the scores of the outer SearchResults can be influenced by the ranking signals of the subquery results. For example, if the[getAggregationScoringStrategy()](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getAggregationScoringStrategy())is set to:

- [JoinSpec.AGGREGATION_SCORING_MIN_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_MIN_RANKING_SIGNAL), the ranking signal of the outer[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)will be set to the minimum of the ranking signals of the subquery results. In this case, it will be the minimum of 2 and 3, which is 2.
- [JoinSpec.AGGREGATION_SCORING_MAX_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_MAX_RANKING_SIGNAL), the ranking signal of the outer[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)will be 3.
- [JoinSpec.AGGREGATION_SCORING_AVG_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_AVG_RANKING_SIGNAL), the ranking signal of the outer[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)will be 2.5.
- [JoinSpec.AGGREGATION_SCORING_RESULT_COUNT](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_RESULT_COUNT), the ranking signal of the outer[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)will be 2 as there are two joined results.
- [JoinSpec.AGGREGATION_SCORING_SUM_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_SUM_RANKING_SIGNAL), the ranking signal of the outer[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)will be 5, the sum of 2 and 3.
- [JoinSpec.AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL), the ranking signal of the outer[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)will stay as it is.

Referring to "this.childrenRankingSignals()" in the ranking signal of the outer query will return the signals calculated by scoring the joined documents using the scoring strategy in the nested[SearchSpec](https://developer.android.com/reference/android/app/appsearch/SearchSpec), as in[SearchResult.getRankingSignal](https://developer.android.com/reference/android/app/appsearch/SearchResult#getRankingSignal()).

## Summary

|                                                                                             ### Nested classes                                                                                             ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [JoinSpec.Builder](https://developer.android.com/reference/android/app/appsearch/JoinSpec.Builder) Builder for[objects](https://developer.android.com/reference/android/app/appsearch/JoinSpec). |

|                                                                                                                ### Constants                                                                                                                ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [AGGREGATION_SCORING_AVG_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_AVG_RANKING_SIGNAL) Score the aggregation of joined documents using the average ranking signal.  |
| `int` | [AGGREGATION_SCORING_MAX_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_MAX_RANKING_SIGNAL) Score the aggregation of joined documents using the largest ranking signal.  |
| `int` | [AGGREGATION_SCORING_MIN_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_MIN_RANKING_SIGNAL) Score the aggregation of joined documents using the smallest ranking signal. |
| `int` | [AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL) Do not score the aggregation of joined documents.          |
| `int` | [AGGREGATION_SCORING_RESULT_COUNT](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_RESULT_COUNT) Score the aggregation of joined documents by counting the number of results.             |
| `int` | [AGGREGATION_SCORING_SUM_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_SUM_RANKING_SIGNAL) Score the aggregation of joined documents using the sum of ranking signal.   |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

|                                                                                                                                                                                           ### Fields                                                                                                                                                                                            ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[JoinSpec](https://developer.android.com/reference/android/app/appsearch/JoinSpec)`>` | [CREATOR](https://developer.android.com/reference/android/app/appsearch/JoinSpec#CREATOR) Creator class for[JoinSpec](https://developer.android.com/reference/android/app/appsearch/JoinSpec). |

|                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                         ||
|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                                    | ` `[getAggregationScoringStrategy](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getAggregationScoringStrategy())`() ` Gets the joined document list scoring strategy.                                                                                                                                        |
| ` `[String](https://developer.android.com/reference/java/lang/String)                     | ` `[getChildPropertyExpression](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getChildPropertyExpression())`() ` The property expression that is used to get values from child documents, returned from the nested search.                                                                                    |
| ` int`                                                                                    | ` `[getMaxJoinedResultCount](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getMaxJoinedResultCount())`() ` Returns the max amount of[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)objects to return with the parent document, with a default of 10 SearchResults. |
| ` `[String](https://developer.android.com/reference/java/lang/String)                     | ` `[getNestedQuery](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getNestedQuery())`() ` Returns the query to run on the joined documents.                                                                                                                                                                    |
| ` `[SearchSpec](https://developer.android.com/reference/android/app/appsearch/SearchSpec) | ` `[getNestedSearchSpec](https://developer.android.com/reference/android/app/appsearch/JoinSpec#getNestedSearchSpec())`() ` Returns the search spec used to retrieve the joined documents.                                                                                                                                             |
| ` void`                                                                                   | ` `[writeToParcel](https://developer.android.com/reference/android/app/appsearch/JoinSpec#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel.                                                                       |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||
| From interface` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` `[describeContents](https://developer.android.com/reference/android/os/Parcelable#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                    | | ` abstract void` | ` `[writeToParcel](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### AGGREGATION_SCORING_AVG_RANKING_SIGNAL

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

```
public static final int AGGREGATION_SCORING_AVG_RANKING_SIGNAL
```

Score the aggregation of joined documents using the average ranking signal.

<br />

Constant Value: 3 (0x00000003)  

### AGGREGATION_SCORING_MAX_RANKING_SIGNAL

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

```
public static final int AGGREGATION_SCORING_MAX_RANKING_SIGNAL
```

Score the aggregation of joined documents using the largest ranking signal.

<br />

Constant Value: 4 (0x00000004)  

### AGGREGATION_SCORING_MIN_RANKING_SIGNAL

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

```
public static final int AGGREGATION_SCORING_MIN_RANKING_SIGNAL
```

Score the aggregation of joined documents using the smallest ranking signal.

<br />

Constant Value: 2 (0x00000002)  

### AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL

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

```
public static final int AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL
```

Do not score the aggregation of joined documents. This is for the case where we want to perform a join, but keep the parent ranking signal.

<br />

Constant Value: 0 (0x00000000)  

### AGGREGATION_SCORING_RESULT_COUNT

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

```
public static final int AGGREGATION_SCORING_RESULT_COUNT
```

Score the aggregation of joined documents by counting the number of results.

<br />

Constant Value: 1 (0x00000001)  

### AGGREGATION_SCORING_SUM_RANKING_SIGNAL

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

```
public static final int AGGREGATION_SCORING_SUM_RANKING_SIGNAL
```

Score the aggregation of joined documents using the sum of ranking signal.

<br />

Constant Value: 5 (0x00000005)

## Fields

### CREATOR

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

```
public static final Creator<JoinSpec> CREATOR
```

Creator class for[JoinSpec](https://developer.android.com/reference/android/app/appsearch/JoinSpec).

<br />

## Public methods

### getAggregationScoringStrategy

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

```
public int getAggregationScoringStrategy ()
```

Gets the joined document list scoring strategy.

The default scoring strategy is[AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL), which specifies that the score of the outer parent document will be used.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_OUTER_RESULT_RANKING_SIGNAL),[AGGREGATION_SCORING_RESULT_COUNT](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_RESULT_COUNT),[AGGREGATION_SCORING_MIN_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_MIN_RANKING_SIGNAL),[AGGREGATION_SCORING_AVG_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_AVG_RANKING_SIGNAL),[AGGREGATION_SCORING_MAX_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_MAX_RANKING_SIGNAL), or[AGGREGATION_SCORING_SUM_RANKING_SIGNAL](https://developer.android.com/reference/android/app/appsearch/JoinSpec#AGGREGATION_SCORING_SUM_RANKING_SIGNAL) <br /> |

**See also:**

- [SearchSpec.RANKING_STRATEGY_JOIN_AGGREGATE_SCORE](https://developer.android.com/reference/android/app/appsearch/SearchSpec#RANKING_STRATEGY_JOIN_AGGREGATE_SCORE)  

### getChildPropertyExpression

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

```
public String getChildPropertyExpression ()
```

The property expression that is used to get values from child documents, returned from the nested search. These values are then used to match them to parent documents. These are analogous to foreign keys.

<br />

|                                                                             Returns                                                                             ||
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the property expression to match in the child documents. This value cannot be`null`. <br /> |

**See also:**

- [JoinSpec.Builder](https://developer.android.com/reference/android/app/appsearch/JoinSpec.Builder)  

### getMaxJoinedResultCount

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

```
public int getMaxJoinedResultCount ()
```

Returns the max amount of[SearchResult](https://developer.android.com/reference/android/app/appsearch/SearchResult)objects to return with the parent document, with a default of 10 SearchResults.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getNestedQuery

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

```
public String getNestedQuery ()
```

Returns the query to run on the joined documents.

<br />

|                                                Returns                                                 ||
|--------------------------------------------------------------------|------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | This value cannot be`null`. <br /> |

### getNestedSearchSpec

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

```
public SearchSpec getNestedSearchSpec ()
```

Returns the search spec used to retrieve the joined documents.

If[Builder.setNestedSearch](https://developer.android.com/reference/android/app/appsearch/JoinSpec.Builder#setNestedSearch(java.lang.String,%20android.app.appsearch.SearchSpec))is never called, this will return a[SearchSpec](https://developer.android.com/reference/android/app/appsearch/SearchSpec)with all default values. This will match every document, as the nested search query will be "" and no schema will be filtered out.

<br />

|                                                          Returns                                                           ||
|----------------------------------------------------------------------------------------|------------------------------------|
| [SearchSpec](https://developer.android.com/reference/android/app/appsearch/SearchSpec) | This value cannot be`null`. <br /> |

### writeToParcel

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

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

|                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | `Parcel`: This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE). Value is either`0`or a combination of[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES <br /> |