> ## 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.

# Geometry of the search area

> How search area geometry forms in FlexiLayouts: boundary coordinate ranges, applying LeftBound constraints, and one-page versus multi-page behavior.

Suppose no search constraints are specified on the **Search Constraints** and **Relations** tabs for the element and its parent **Group** elements. In this case, before FlexiLayout Studio applies the constraints from the **Advanced pre-search relations** section, the search area of the element coincides with the rectangle of the page. If there are no additional constraints on the **Advanced** tab, FlexiLayout Studio looks for the element on the entire page.

## How constraints shape the search area

Applying constraints of type 1, 2, and 4 described in [Search constraints](/flexi-capture/fls/language/search-conditions) creates a search area consisting of an array of rectangles. FlexiLayout Studio takes the search area to consist of one rectangle that circumscribes the entire array, from which a specified set of rectangles (excluded rectangles) must be excluded.

Applying the search constraints of type 3 described in [Search constraints](/flexi-capture/fls/language/search-conditions) creates a range of allowed coordinates for each boundary of the hypotheses: left, right, top, and bottom. Each boundary is characterized by a range of coordinates on the corresponding axis, for example, `[x1, x2]` or `[y1, y2]`. Here `x1` and `x2` are of type `XCoordinate`, and `y1` and `y2` are of type `YCoordinate`. The section of the axis must meet the following condition: `x1 <= x2` for the X-coordinates, and `y1 <= y2` for the Y-coordinates.

If several constraints are consecutively applied to a boundary, each constraint changes the range of allowed coordinates for the boundary.

## Example of LeftBound constraints

Suppose the **Advanced pre-search relations** section contains the following constraints:

```text theme={null}
LeftBound > 5mm;
LeftBound < 15mm;
LeftBound < 10mm;
```

Suppose the search area is not specified before these constraints run. For a one-page FlexiLayout (where the minimum and maximum allowed number of pages in a document is 1), the search area coincides with the rectangle of the page `[PageRect.Left, PageRect.Top, PageRect.Right, PageRect.Bottom]`. For a multi-page FlexiLayout, the search area has the maximum size of `[-INF, -INF, INF, INF]`.

The coordinate ranges of the element boundaries are as follows:

| **Boundary**  | **Range for one-page FlexiLayout** | **Range for multi-page FlexiLayout** |
| ------------- | ---------------------------------- | ------------------------------------ |
| `LeftBound`   | `[PageRect.Left, PageRect.Right]`  | `[-INF, INF]`                        |
| `TopBound`    | `[PageRect.Top, PageRect.Bottom]`  | `[-INF, INF]`                        |
| `RightBound`  | `[PageRect.Left, PageRect.Right]`  | `[-INF, INF]`                        |
| `BottomBound` | `[PageRect.Top, PageRect.Bottom]`  | `[-INF, INF]`                        |

When the constraint `LeftBound > 5mm` is executed, only the left boundary changes. The range of its possible values becomes the segment `[5mm, PageRect.Right]` for one-page FlexiLayouts and the segment `[5mm, INF]` for multi-page FlexiLayouts.

After the `LeftBound < 15mm` constraint is applied, the range of allowed coordinates of the left boundary will be `[5mm, 15mm]`.

After the `LeftBound < 10mm` constraint is applied, the range of allowed coordinates of the left boundary will be `[5mm, 10mm]`.

Similarly, you can set constraints for the other boundaries of the element.

The specified boundaries of the search area form a [fuzzy rectangle](/flexi-capture/fls/language/fuzzy-rect).
