---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

1.  [](/)
2.  [Diagrams](/diagrams)
3.  Three Results Went In. Seven Rows Came Out: What Unwind Actually Does to a Result Set

[Back to Diagrams](/diagrams)Retrieval Mechanics

# Three Results Went In. Seven Rows Came Out: What Unwind Actually Does to a Result Set

One search for a nylon hiking backpack returns three documents. Two carry no edges and are dropped entirely by the unwind stage; the third carries seven edges and becomes seven rows. input\_count 3, output\_count 7, and the two dropped documents never appear as empty rows because preserve\_null\_and\_empty defaults to false.

![A portrait diagram showing the unwind retriever stage on one real run. Three input documents are shown: Ripstop Hiking Backpack and Canvas Hiking Backpack are dashed and greyed with an x mark, each carrying zero edges, while Nylon Hiking Backpack is solid with a check mark and seven edges. A config divider shows the unwind stage on the edges field. Below it, seven output rows each carry a rose index badge numbered 0 through 6, all labelled same\_material, each paired with a SKU from MXP-TEN-1060 through MXP-TEN-1078. A footer reads input\_count 3, output\_count 7, preserve\_null\_and\_empty false.](/diagrams/unwind-expansion.webp)Full screen

One search for a nylon hiking backpack returns three documents. Two carry no edges and are dropped entirely by the unwind stage; the third carries seven edges and becomes seven rows. input\_count 3, output\_count 7, and the two dropped documents never appear as empty rows because preserve\_null\_and\_empty defaults to false.

unwind decomposes an array field into one document per member. Most people meet it as a 1-to-N expansion, which it is. The half that surprises people is that it also removes documents: if the array is empty, the document does not survive the stage.

This diagram is drawn from one search for "nylon hiking backpack" against a 118-image product catalog, final\_top\_k 3. Three documents came back. Ripstop Hiking Backpack and Canvas Hiking Backpack each carried zero edges. Nylon Hiking Backpack carried seven, all typed same\_material, each pointing at a tent SKU that shares its material. Running unwind on the edges field, stage\_statistics reported input\_count 3, output\_count 7. Every edge on this document is same\_material because that is the only edge type this corpus produces; a richer graph would be invented rather than shown.

The part worth knowing before shipping it: preserve\_null\_and\_empty defaults to false. The two backpacks with no edges are not passed through as empty rows, they are gone. Three in, seven out, and the arithmetic hides the fact that two of the three inputs contributed nothing and vanished.

That matters most for paging. After an unwind, page size counts array members, not the documents a caller thinks they are paging through. A page of 25 might be four products or it might be one product with 25 edges, and the response does not distinguish them. Set preserve\_null\_and\_empty to true when the absence is itself the answer, for example when auditing which products have no relationships at all. The default is right for the common case and wrong for that one.

Of the 118 documents in this catalog, 28 carry edges and every one of them carries exactly seven, all same\_material. Counts, edge payloads and SKUs above are from one execution with skip\_cache true, not reconstructed from a schema.

## Where this diagram appears

*   [Unwind retriever stage →](/retrievers/unwind)
*   [Traverse edge stage →](https://docs.mixpeek.com/retrieval/stages/traverse-edge)
*   [Docs: the unwind stage →](https://mixpeek.com/docs/retrieval/stages/unwind)

Run this on your own data

Mixpeek turns video, images, audio, and documents in your object storage into searchable, timestamped results through one API.

[Search your own data](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=diagram_detail&utm_campaign=mvs_onramp)

## Related diagrams

[

![A portrait diagram in two rails. The headline reads Filters exclude, what ranking would have shown, with the subline: a pre\_filter drops rows before ranking is ever shown to you, useful, and it hides what it removed. A search bar holds the query yellow armchair, annotated: three of the top five are out of stock. Rail A, badged no filter, shows five armchair photos in rank order with prices and scores: 872 dollars at 0.080, 515 dollars at 0.065, 180 dollars at 0.060, 451 dollars at 0.060 and 506 dollars at 0.057; the second, third and fourth are greyed and stamped dropped, and the count chip reads 5 of 5. Rail B, badged pre\_filter with in\_stock equals true, shows the two survivors at 872 and 506 dollars followed by three new armchairs at 123 dollars 0.048, 446 dollars 0.047 and 606 dollars 0.046; its chip reads 2 kept plus 3 new. A bold line states that three of the top five were out of stock and all three were removed from the response entirely. A dark code window shows the execute request with the filters line in\_stock true highlighted, and skip\_cache true. The footer prints mxp.co/d/filters-exclude and the words real query, real ranking, mixpeek.](/diagrams/filters-exclude.webp)

Filters Exclude What Ranking Would Have Shown



](/diagrams/filters-exclude)[

![A portrait diagram in two rails. The headline reads Scope decides, what can be found at all, with the subline: the same question, asked of the whole catalog and then of one category. The search bar holds the query something to keep me warm outside, annotated: the query names no category. Rail A, badged whole catalog with the note semantic reach across every category, shows five photos in rank order: a lit tent at night for 543 dollars at 0.062, a snowy forest scene for 564 dollars at 0.060, a steaming pot on a stove for 444 dollars at 0.059, boots on a textured rug for 203 dollars at 0.052, and a tent under a starry sky for 100 dollars at 0.048; the second, third and fourth are greyed and stamped dropped, and the chip reads 5 of 5. Rail B, badged scoped with category equals tent and the note only one category can answer, shows the two surviving tents followed by three more tents at 592 dollars 0.046, 73 dollars 0.039 and 554 dollars 0.029; its chip reads 2 kept plus 3 new. A bold line states that unscoped, the index answered with tents, backpacks, rugs and pans, and that scope is a decision about what is allowed to be right. A code window shows the execute request with the filters line category tent highlighted. The footer prints mxp.co/d/scope-changes-candidates.](/diagrams/scope-changes-candidates.webp)

Scope Decides What Can Be Found at All



](/diagrams/scope-changes-candidates)[

![A portrait diagram in two rails. The headline reads A price ceiling, is not a price sort, with the subline: a price ceiling removes the expensive matches, it does not promote the cheap ones by price. The search bar holds the query premium floor lamp, annotated: premium is a word, not a number. Rail A, badged no ceiling with the note best matches, any price, shows five photos in rank order: floor lamps at 729 dollars 0.097, 299 dollars 0.093, 908 dollars 0.092 and 322 dollars 0.089, then an armchair at 451 dollars 0.086; four are greyed and stamped dropped, only the 299 dollar lamp survives, and the chip reads 5 of 5. Rail B, badged pre\_filter with price less than 300 and the note best matches under the ceiling, shows the 299 dollar lamp first at 0.093, then lamps at 230 dollars 0.071, 104 dollars 0.068, 129 dollars 0.063 and 38 dollars 0.059; its chip reads 1 kept plus 4 new. A bold line states that rank order inside the filter is still semantic, so the cheapest item lands fourth. A code window shows the execute request with the filters line price lt 300 highlighted. The footer prints mxp.co/d/numeric-filter-reranks.](/diagrams/numeric-filter-reranks.webp)

A Price Ceiling Cuts the Set and Leaves the Order Semantic



](/diagrams/numeric-filter-reranks)