---
title: "search single · RUAL Documentation"
description: "searches in the given storage based on a query and returns maximum one result."
canonical: https://docs.rual.nl/block-types/storage/function_search_single_result
language: en
---

# search single

This block is part of the [`storage`](https://docs.rual.nl/block-types/storage) group and was last modified in core [`v13.0.4`](https://docs.rual.nl/core-versions/130004).

### Storage Selection Required

This block relies on a storage to perform its storage releated actions. You must manually select the storage you want to use in your flow using the storage selector modal. To access the modal, click the white button on the block.

searches in the given storage based on a query and returns maximum one result.

- flow `flow`

- Query required `query` Search will return cached results by default. Turn this behaviour off by adding `Disable cache` to this query. • Suggestions: `query_bool_must` `query_bool_must_not` `query_bool_should`

- Cache Key `v13.0.4` `value` You can use this option to serve cached results for frequently used and resource-intensive searches. If the data doesn't change, repeated searches with the same cache key retrieve results from the same request cache. For time series use cases, such as logging, data in older data is rarely updated and can be served directly from this cache.

- Storage `storage`

- flow `flow`

- Result `object` The result if one has been found.

- guid `value` The guid of the result if one has been found.

- Has result `condition`

- success `condition`

- error `value`

| `database` |
| --- |

[search single](https://docs.rual.nl/block-types/storage/function_search_single_result) is [search](https://docs.rual.nl/block-types/storage/function_search) for exactly one document: the query pins work the same (a term from [fields](https://docs.rual.nl/block-types/query/query_bool_term_fields) inside [must](https://docs.rual.nl/block-types/query/query_bool_must)), and the has result pin tells a [branch](https://docs.rual.nl/block-types/flow/branch) whether anything matched before [get fields](https://docs.rual.nl/block-types/object/object_field_getter_multiple) reads the object.

![Studio canvas example for the search single block: searching for one document.](https://docs.rual.nl/canvas-examples/function_search_single_result.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [branch](https://docs.rual.nl/block-types/flow/branch): wired in both directions with this block.

- [get fields](https://docs.rual.nl/block-types/object/object_field_getter_multiple): this block feeds into it. Gets the selected fields from the given object.

- [must](https://docs.rual.nl/block-types/query/query_bool_must): feeds into this block. All queries provided must match.

- [filter](https://docs.rual.nl/block-types/query/query_bool_filter): feeds into this block. Build a custom query using higher-level bool query.

- [update document](https://docs.rual.nl/block-types/storage/function_update_document_mutations): this block feeds into it. Update document in the given storage and creates a revision for it.

- [multiple](https://docs.rual.nl/block-types/query/query_and): feeds into this block.

### Used in these guides

These documentation pages use or explain this block:

- [Storage Examples](https://docs.rual.nl/blueprints/storage-examples)

- [Example: E-Commerce Catalog](https://docs.rual.nl/examples/ecommerce-catalog)

- [Example: Simple Blog](https://docs.rual.nl/examples/simple-blog)

- [Block Quick Reference](https://docs.rual.nl/reference/block-quick-reference)

### Version history

Introduced in [`v10.6.2`](https://docs.rual.nl/core-versions/100602).

Last modified in [`v13.0.4`](https://docs.rual.nl/core-versions/130004).
