# GetSearchStringParameterNode

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/ast/query/GetSearchStringParameterNode.java+class:androidx.appsearch.ast.query.GetSearchStringParameterNode) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
@ExperimentalAppSearchApi
public final class GetSearchStringParameterNode implements FunctionNode
```

<br />

*** ** * ** ***

`https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode` that represents the getSearchStringParameter function.

The getSearchStringParameter function retrieves the String parameter stored at the index in the list provided by `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec#getSearchStringParameters()`.

The String parameter can be used in a query and is treated as plain text. It will be segmented, normalized, and stripped of punctuation. Operators such as `AND` will be treated as plain text while operators such as negation ("-") and property restricts (":") will be treated as punctuation and removed.

So for the query \`foo OR getSearchStringParameter(0)\`, where getSearchStringParameter(0) contains "bar AND sender:recipient", the string will be segmented into

- bar
- AND
- sender
- :
- recipient

Then the punctuation will be removed and the remaining tokens ANDed together. This means the resulting query is equivalent to the query \`foo OR (bar AND and AND sender AND recipient)\`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode#GetSearchStringParameterNode(int)(int searchStringIndex)` Constructor for `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode` that takes in the index of the SearchString parameter provided in `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec#getSearchStringParameters()`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html o)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode#getFunctionName()()` Returns the name of the function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`. |
| `int` | `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode#getSearchStringIndex()()` Returns the index of the SearchString parameter to be retrieved from `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec#getSearchStringParameters()`. |
| `int` | `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode#hashCode()()` |
| `void` | `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode#setSearchStringIndex(int)(int searchStringIndex)` Sets the index of the SearchString parameter provided in `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec#getSearchStringParameters()` to be represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode#toString()()` Returns the string representation of `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`. |

| ### Inherited Constants |
|---|
| From [androidx.appsearch.ast.FunctionNode](https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode) |---|---| | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_GET_SEARCH_STRING_PARAMETER() = "getSearchStringParameter"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_HAS_PROPERTY() = "hasProperty"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/HasPropertyNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_PROPERTY_DEFINED() = "propertyDefined"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/PropertyDefinedNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_SEARCH() = "search"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/SearchNode`. | | `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/ast/FunctionNode#FUNCTION_NAME_SEMANTIC_SEARCH() = "semanticSearch"` Name of the query function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/SemanticSearchNode`. | |

| ### Inherited methods |
|---|
| From [androidx.appsearch.ast.Node](https://developer.android.com/reference/androidx/appsearch/ast/Node) |---|---| | `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/ast/Node>` | `https://developer.android.com/reference/androidx/appsearch/ast/Node#getChildren()()` Get a list of the node's child `https://developer.android.com/reference/androidx/appsearch/ast/Node`s. | |

## Public constructors

### GetSearchStringParameterNode

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

```
public GetSearchStringParameterNode(int searchStringIndex)
```

Constructor for `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode` that takes in the index of the SearchString parameter provided in `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec#getSearchStringParameters()`.

## Public methods

### equals

```
public boolean equals(Object o)
```

### getFunctionName

```
public @NonNull String getFunctionName()
```

Returns the name of the function represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`.

### getSearchStringIndex

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

```
public int getSearchStringIndex()
```

Returns the index of the SearchString parameter to be retrieved from `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec#getSearchStringParameters()`.

### hashCode

```
public int hashCode()
```

### setSearchStringIndex

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

```
public void setSearchStringIndex(int searchStringIndex)
```

Sets the index of the SearchString parameter provided in `https://developer.android.com/reference/androidx/appsearch/app/SearchSpec#getSearchStringParameters()` to be represented by `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`.

### toString

```
public @NonNull String toString()
```

Returns the string representation of `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode`.

The string representation of `https://developer.android.com/reference/androidx/appsearch/ast/query/GetSearchStringParameterNode` is the function name followed by the `searchStringIndex` surrounded by parentheses. For example, the string representation of `GetSearchStringParameterNode(1)` is \`getSearchStringParameter(1)\`.