Every PPL query starts with the `search` command. It specifies the index to search and retrieve documents from. Subsequent commands can follow in any order.
Currently, `PPL` supports only one `search` command, which can be omitted to simplify the query.
{ : .note}
## Syntax
```sql
search source=<index> [boolean-expression]
source=<index> [boolean-expression]
```
Field | Description | Required
:--- | :--- |:---
`search` | Specifies search keywords. | Yes
`index` | Specifies which index to query from. | No
`bool-expression` | Specifies an expression that evaluates to a Boolean value. | No
## Examples
**Example 1: Search through accounts index**
In the following example, the `search` command refers to an `accounts` index as the source and uses `fields` and `where` commands for the conditions:
```sql
search source=accounts
| where age > 18
| fields firstname, lastname
```
In the following examples, angle brackets `< >` enclose required arguments and square brackets `[ ]` enclose optional arguments.
{: .note }
**Example 2: Get all documents**
To get all documents from the `accounts` index, specify it as the `source`:
```sql
search source=accounts;
```
| account_number | firstname | address | balance | gender | city | employer | state | age | email | lastname |