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

# Search control functions

> Control element searches in the FlexiLayout language with Optional, StopIfFound, DontFind, and MaxHypothesesCount functions for hypothesis generation.

The FlexiLayout language provides the following functions for controlling element searches and hypothesis generation.

## Search control functions

| Definition                               | Description                                                                                                                                                                                                                                                                        |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Void Optional( Real q1, Real q2 )`      | Makes an element optional. The `q1` parameter sets the quality of the null hypothesis. The `q2` parameter sets the criterion for formulating the null hypothesis: the null hypothesis is formulated if no other hypotheses are created whose qualities exceed a certain threshold. |
| `Void StopIfFound( Logic Value = true )` | Stops generating hypotheses in the branch if it contains a non-null hypothesis for the given element. For more information, see [Required, optional, and prohibited elements](/flexi-capture/fls/template/elements-optional).                                                      |
| `Void DontFind()`                        | Tells FlexiLayout Studio not to look for an element. If the element is optional, only the null hypothesis is formulated.                                                                                                                                                           |
| `Void MaxHypothesesCount( Int )`         | Sets the maximum number of hypotheses for an element.                                                                                                                                                                                                                              |
