> ## Documentation Index
> Fetch the complete documentation index at: https://developer.kodexa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Find Nodes by Combined Criteria

> Use kdx document find to search KDDB documents with combined criteria across content, node type, page, tags, and spatial regions using AND logic.

Find nodes matching multiple criteria simultaneously. Combines text search, node type filtering, page filtering, tag matching, and spatial region queries with AND logic.

## Usage

```bash theme={null}
kdx document find <file.kddb> [flags]
```

At least one filter flag is required.

## Flags

| Flag                   | Description                                 | Default       |
| ---------------------- | ------------------------------------------- | ------------- |
| `--contains`           | Text/regex search pattern                   |               |
| `--type`               | Filter by node type (e.g., line, paragraph) |               |
| `--page N`             | Filter by page number (1-based)             |               |
| `--tag`                | Filter by tag name                          |               |
| `--region x1,y1,x2,y2` | Spatial bounding box filter                 |               |
| `--max N`              | Maximum number of results                   | 0 (unlimited) |
| `--pretty`             | Pretty-print JSON output                    | false         |

## Examples

### Combined Filters

```bash theme={null}
kdx document find doc.kddb --contains "total" --type line --page 3
```

```json theme={null}
{"nodeId":142,"type":"line","content":"Total Revenue: $1,234,567","page":3,"matchStart":0,"matchEnd":5}
```

### Spatial Region Search

```bash theme={null}
kdx document find doc.kddb --region 0,0,300,100 --page 1
```

### Find by Tag

```bash theme={null}
kdx document find doc.kddb --tag kodexa/amount --max 10 --pretty
```

<Tip>
  Combine `--contains` with `--region` to search for text within a specific area of a page, useful for form field extraction.
</Tip>
