---
title: "search as you type · RUAL Documentation"
description: "Matches documents whose field starts with the given phrase, analyzed on both sides. Use this for type-ahead: the last word is treated as a prefix and th…"
canonical: https://docs.rual.nl/block-types/query/query_bool_match_phrase_prefix
language: en
---

# search as you type

This block is part of the [`query`](https://docs.rual.nl/block-types/query) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

### Field Selection Required

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

### Connection Type

This block connects from a `query` type block. Make sure to connect this block to the appropriate left-hand side connection.

### Parent Requirements

This block requires specific parent elements: `query_bool_must`, `query_bool_must_not`, `query_bool_filter`, `query_bool_should`, `query_first_defined`. Ensure this block is placed within the appropriate parent context.

Matches documents whose field starts with the given phrase, analyzed on both sides. Use this for type-ahead: the last word is treated as a prefix and the input goes through the same analyzer as the stored text, so `mssgs test` matches `MSSGS-Test-1`. For an exact, unanalyzed prefix on a keyword field use `starts with` instead.

- value required `value` The (partial) phrase to search for. Only the last word is treated as a prefix.

- max expansions `number` How many terms the trailing prefix may expand into per shard. Empty uses the Elasticsearch default of 50; raise it when a high-cardinality field seems to miss matches.

Default `50`

- slop `number` How far the words may be apart. `0` (the default) requires them in the exact order, next to each other.

Default `0`

- boost `number` The amount of score boosting would be applied whenever this matches.

Default `1`

- query `query`

| `match phrase prefix` |
| --- |
| `starts with phrase` |
| `type ahead` |
| `autocomplete` |
| `search as you type` |

A typical wiring for [search as you type](https://docs.rual.nl/block-types/query/query_bool_match_phrase_prefix): the `query` out pin feeds [cast to object](https://docs.rual.nl/block-types/query/query_convert_to_object).

![Studio canvas example for the search as you type block: typical wiring for search as you type.](https://docs.rual.nl/canvas-examples/query_bool_match_phrase_prefix.png)

### Version history

Introduced in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).
