> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Field Query

> Search for entities by specific field values

# Field Query

Search for entities by matching a specific field to a given value. This is useful for finding entities that have a particular column name, tag, owner, or other field-level attribute.

## Query Parameters

**fieldName** `string` *required*

Field path to search. Common values: `columns.name`, `tags.tagFQN`, `owners.name`, `service.name`, `database.name`, `databaseSchema.name`.

**fieldValue** `string` *required*

Value to match against the specified field.

**index** `string` *required*

Search index to query. Options: `table_search_index`, `topic_search_index`, `dashboard_search_index`, `pipeline_search_index`, `mlmodel_search_index`, `container_search_index`, `search_entity_search_index`, `glossary_term_search_index`, `tag_search_index`, `user_search_index`, `team_search_index`, `domain_search_index`, `data_product_search_index`.

**from** `integer` (default: 0)

Starting offset for pagination. Must be 0 or greater. A negative value returns `400`.

**size** `integer` (default: 10)

Number of results to return. Must be 0 or greater. A negative value returns `400`.

```python GET /v1/search/fieldQuery theme={null}
from urllib.parse import urlencode

from metadata.sdk import client, configure

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)
rest = client().ometa.client

# Find tables with a specific column name
params = urlencode({
    "fieldName": "columns.name",
    "fieldValue": "shop_id",
    "index": "table_search_index"
})
response = rest.get(f"/search/fieldQuery?{params}")

for hit in response["hits"]["hits"]:
    entity = hit["_source"]
    print(f"{entity['fullyQualifiedName']} (score: {hit['_score']})")

# Find entities with a specific tag
params = urlencode({
    "fieldName": "tags.tagFQN",
    "fieldValue": "PII.Sensitive",
    "index": "table_search_index"
})
response = rest.get(f"/search/fieldQuery?{params}")

for hit in response["hits"]["hits"]:
    entity = hit["_source"]
    print(f"{entity['fullyQualifiedName']}")
```

```java GET /v1/search/fieldQuery theme={null}
// client is an initialized OpenMetadataClient.
// Find tables with a specific column name
var response = client.searchApi().fieldQuery(
    "columns.name",        // fieldName
    "shop_id",             // fieldValue
    "table_search_index",  // index
    0,                     // from
    10                     // size
);

for (var hit : response.getHits().getHits()) {
    var source = hit.getSource();
    System.out.println(source.getFullyQualifiedName());
}
```

```bash GET /v1/search/fieldQuery theme={null}
# Find tables with a specific column name
curl "{base_url}/api/v1/search/fieldQuery?fieldName=columns.name&fieldValue=shop_id&index=table_search_index" \
  -H "Authorization: Bearer {access_token}"

# Find entities with a specific tag
curl "{base_url}/api/v1/search/fieldQuery?fieldName=tags.tagFQN&fieldValue=PII.Sensitive&index=table_search_index" \
  -H "Authorization: Bearer {access_token}"

# Find entities owned by a specific user
curl "{base_url}/api/v1/search/fieldQuery?fieldName=owners.name&fieldValue=admin&index=table_search_index&size=20" \
  -H "Authorization: Bearer {access_token}"
```

```json Response theme={null}
{
  "took": 5,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "failed": 0,
    "skipped": 0
  },
  "hits": {
    "total": {
      "value": 12,
      "relation": "eq"
    },
    "hits": [
      {
        "_index": "table_search_index",
        "_id": "7c2191b6-81da-4c97-83c4-1a537e54a3b0",
        "_score": 1.8,
        "_source": {
          "id": "7c2191b6-81da-4c97-83c4-1a537e54a3b0",
          "name": "dim_customer",
          "fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_customer",
          "entityType": "table",
          "serviceType": "BigQuery",
          "description": "Customer dimension table with shop_id reference",
          "owners": [],
          "tags": [],
          "columns": [
            {
              "name": "shop_id",
              "dataType": "NUMERIC",
              "fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_customer.shop_id"
            }
          ]
        }
      }
    ]
  }
}
```

***

## Returns

Returns an Elasticsearch-style response containing entities where the specified field matches the given value.

## Response

**took** `integer`

Time in milliseconds the search took to execute.

**timed\_out** `boolean`

Whether the search timed out.

**hits** `object`

Search results container.

**properties**

**total** `object`

Total hit count information.

**properties**

**value** `integer`

Total number of matching entities.

**relation** `string`

Relation to the actual count. `eq` means exact, `gte` means the count is a lower bound.

**hits** `array`

Array of matching entity results.

**properties**

**\_index** `string`

Search index the result was found in.

**\_id** `string`

Unique identifier of the entity (UUID format).

**\_score** `number`

Relevance score for the match.

**\_source** `object`

The full entity object. Contents vary by entity type but always include `id`, `name`, `fullyQualifiedName`, and `entityType`.

***

## Common Field Paths

| Field Path | Description | Applicable Indexes |
| - | - | - |
| `columns.name` | Column name within a table | `table_search_index` |
| `tags.tagFQN` | Fully qualified tag name, for example `PII.Sensitive` | All indexes |
| `owners.name` | Owner username | All indexes |
| `service.name` | Service name | All entity indexes |
| `database.name` | Database name | `table_search_index` |
| `databaseSchema.name` | Schema name | `table_search_index` |

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Missing required parameters, invalid field path, or a negative `from` or `size` |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to search entities |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.