# Item Segments Handling

> Source: https://docs.recombee.com/reql/functions/item-segments

> For the complete documentation index, see [llms.txt](/llms.txt).

# Item Segments Handling

| Name                                       | Description                                 | Example                                          |
| ------------------------------------------ | ------------------------------------------- | ------------------------------------------------ |
| [segment\_items](#reql-func-segment-items) | Get items in a Segment                      | 'itemId' in segment\_items("genres", "thriller") |
| [item\_segments](#reql-func-item-segments) | Get Item Segments to which the item belongs | "thriller" in item\_segments("genres", 'itemId') |

## Items in a Segment

Gets Items belonging to an [Item Segment](/segmentations).

### Definition

```
segment_items(segmentation_id, segment_id)
```

| Argument         | Type   | Meaning                                     |
| ---------------- | ------ | ------------------------------------------- |
| segmentation\_id | string | ID of an Item Segmentation                  |
| segment\_id      | string | ID of a Segment from the given Segmentation |

### Example

```
// Allow only thrillers
'itemId' in segment_items("genres", "thriller")
```

## Item Segments of an Item

Given an [Item Segmentation](/segmentations) and an Item, get a set of Item Segments to which the Item belongs.

### Definition

```
item_segments(segmentation_id, item_id)
```

| Argument         | Type   | Meaning                    |
| ---------------- | ------ | -------------------------- |
| segmentation\_id | string | ID of an Item Segmentation |
| item\_id         | string | ID of an Item              |

### Example

```
// Allow only thrillers
"thriller" in item_segments("genres", 'itemId')
```