> ## Documentation Index
> Fetch the complete documentation index at: https://the-early-spring18.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Your Workspace Data Effectively Using Google

> Learn how to use full-text search, apply filters, use advanced query syntax, and sort and paginate results to find exactly what you need.

Google's search engine is built to surface the right information quickly, no matter how large your workspace has grown. Every document, record, tag, and annotation you store is indexed automatically, giving you full-text search across your entire dataset without any manual configuration. Whether you're hunting for a report from six months ago, filtering by a specific data type, or building an automated pipeline that queries your workspace programmatically, this guide covers the tools and techniques you need to search with precision and confidence.

## Basic Search

The fastest way to search is directly from the search bar at the top of the dashboard. Type any keyword, phrase, or partial term and Google returns ranked results in real time as you type. Results include documents, records, notes, and any other data types your workspace contains.

You can also perform a basic search through the REST API by sending a `GET` request to the `/search` endpoint:

```http theme={null}
GET https://api.google.com/v1/search?q=quarterly+report
Authorization: Bearer YOUR_API_KEY
```

Results are returned in descending order of relevance by default. Each result object includes the item's `id`, `title`, `type`, `score`, and a short `excerpt` showing where the query term was matched.

## Search Filters

Filters let you narrow results to a specific subset of your data. You can apply filters through the sidebar in the dashboard UI or by appending query parameters to API requests.

**Supported filter parameters:**

| Parameter               | Description                                            | Example                            |
| ----------------------- | ------------------------------------------------------ | ---------------------------------- |
| `filter=type:<value>`   | Restrict results to a specific data type               | `type:document`, `type:note`       |
| `from=<date>`           | Return items created on or after this date (ISO 8601)  | `from=2024-01-01`                  |
| `to=<date>`             | Return items created on or before this date (ISO 8601) | `to=2024-06-30`                    |
| `filter=tag:<value>`    | Match items with a specific tag                        | `tag:finance`                      |
| `filter=status:<value>` | Match items by status                                  | `status:published`, `status:draft` |

Combine multiple filters in a single request by chaining them with `&`:

```http theme={null}
GET https://api.google.com/v1/search?q=report&filter=type:document&from=2024-01-01&to=2024-12-31&filter=tag:finance
Authorization: Bearer YOUR_API_KEY
```

<Info>
  You can stack multiple `filter` parameters in the same request. Google applies all filters with an implicit AND — results must satisfy every filter condition to appear in the response.
</Info>

## Advanced Query Syntax

For more precise control, Google supports a rich query syntax directly within the search term. You can use these operators in both the dashboard search bar and the `q` parameter of the API.

<Tabs>
  <Tab title="Boolean Operators">
    | Operator | Usage                             | Example               |
    | -------- | --------------------------------- | --------------------- |
    | `AND`    | Both terms must be present        | `budget AND forecast` |
    | `OR`     | Either term may be present        | `invoice OR receipt`  |
    | `NOT`    | Exclude items containing the term | `report NOT draft`    |
  </Tab>

  <Tab title="Phrase and Wildcard">
    | Syntax        | Usage                             | Example                             |
    | ------------- | --------------------------------- | ----------------------------------- |
    | `"..."`       | Exact phrase match                | `"annual report"`                   |
    | `*`           | Wildcard — matches any characters | `annu*` matches `annual`, `annuity` |
    | `field:value` | Search within a specific field    | `title:budget`, `author:jane`       |
  </Tab>

  <Tab title="Field Targeting">
    Target your query at a specific metadata field to avoid noise from full-text matches:

    ```
    title:"Q3 Report"
    author:jane
    tag:urgent AND status:published
    ```

    Supported field targets include `title`, `author`, `tag`, `status`, `type`, and `description`.
  </Tab>
</Tabs>

## Sorting and Pagination

By default, results are sorted by relevance. You can change the sort order and control how many results are returned per page using the following parameters:

```http theme={null}
GET https://api.google.com/v1/search?q=report&sort=date&order=desc&page=2&limit=25
Authorization: Bearer YOUR_API_KEY
```

**Sort and pagination parameters:**

| Parameter | Values                       | Default     |
| --------- | ---------------------------- | ----------- |
| `sort`    | `relevance`, `date`, `title` | `relevance` |
| `order`   | `asc`, `desc`                | `desc`      |
| `page`    | Any positive integer         | `1`         |
| `limit`   | `1`–`100`                    | `20`        |

Use `page` and `limit` together to page through large result sets. The response envelope includes a `total` field indicating the overall number of matching items, which you can use to calculate the number of available pages.

## Search via API

For full programmatic access, use the search endpoint with your API key and optional request body filters. The example below performs a filtered, paginated search and shows the expected response shape:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.google.com/v1/search?q=annual+report&filter=type:document&sort=date&limit=5" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.google.com/v1/search",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      params={
          "q": "annual report",
          "filter": "type:document",
          "sort": "date",
          "limit": 5,
      },
  )
  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.google.com/v1/search?q=annual+report&filter=type:document&sort=date&limit=5',
    {
      headers: {
        Authorization: 'Bearer YOUR_API_KEY',
        Accept: 'application/json',
      },
    }
  );
  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

**Example JSON response:**

```json theme={null}
{
  "total": 142,
  "page": 1,
  "limit": 5,
  "results": [
    {
      "id": "doc_9f3a21",
      "title": "Annual Report 2024",
      "type": "document",
      "score": 0.97,
      "created_at": "2024-03-15T09:00:00Z",
      "excerpt": "...highlights from the <em>annual report</em> include a 22% increase..."
    },
    {
      "id": "doc_7c18de",
      "title": "Annual Report 2023",
      "type": "document",
      "score": 0.91,
      "created_at": "2023-03-12T08:45:00Z",
      "excerpt": "...the <em>annual report</em> summarizes financial performance across all regions..."
    }
  ]
}
```

<Note>
  Newly created or updated items may take a few seconds to appear in search results due to indexing latency. If you've just added data and don't see it yet, wait 5–10 seconds and try your query again. For near-real-time use cases, use the direct item retrieval endpoint (`GET /v1/items/:id`) rather than search.
</Note>
