Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions content/connectivity/magento-2/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,34 @@ In this example we will search for customers that were updated after 1985 (`@dat
# ...
```

#### With long filter
Filters are passed on the url.
But the most popular web browsers will not work with URLs over 2000 characters, and would return a 414 (Request-URI Too Long).
You can use the method withLongFilter to avoid this limitation and batch your request in multiple requests.

In this example we will search for specifics orders with a lot of data, we have 214 increment_id, and we use a withLongFilter with parameters '@order_filter' (like the withFilter method), but we have 2 additional parameters who defines an offset and a lenght.
The offset can help you to start the request at the chosen index, by default we have 0.
The lenght help you to define a batch lenght, by default we have 200.
Here we have defined an offset to 0 and a lenght to 150, it means we are starting the request to the first element and make multiple request with 150 items max.
```yaml
# ...
order_filter_group:
class: Kiboko\Component\Flow\Magento2\FilterGroup
calls:
- withLongFilter: [ '@order_filter' ]
order_filter:
class: Kiboko\Component\Flow\Magento2\FilterGroup
calls:
- withLongFilter: ['@order_increment_id', 0, 150]
order_increment_id:
class: Kiboko\Component\Flow\Magento2\Filter
arguments:
- 'increment_id'
- 'in'
- '000000526,4000000026,00000918,000001754,6000000123,4000000150,6000000185,000003798,6000000211,6000000230,000004664,000004950,6000000265,6000000293,000008038,000008842,6000000475,6000000494,6000000500,000012074,000012247,000012453,000012589,2000000159,000014903,6000000760,6000000776,000016545,4000000530,000016553,4000000531,000016567,000016593,000016623,000016631,000016636,000016642,000016646,000016649,000016662,000016684,000016687,000016690,000016700,000016706,000016731,000016743,000016751,000016755,000016770,000016771,000016775,000016782,000016805,000016820,000016826,000016832,000016836,000016837,000016839,000016841,000016842,000016843,000016845,000016849,000016851,000016852,000016858,000016859,000016862,000016863,000018513,6000000947,4000000604,000021935,000021938,000021944,000022086,000022515,000022582,000022613,000022682,000022998,000023200,000023201,000023202,000023203,6000001188,000023204,000023205,000023206,6000001189,000023207,000023208,000023209,000023210,000023211,000023212,000023213,000023216,000023218,000023219,000023220,000023221,6000001190,000023229,000023230,6000001191,000023232,000023236,6000001192,000023238,000023243,000023244,000023245,000023249,000023250,3000000086,23253,000023257,000023258,6000001194,6000001195,000023269,000023274,6000001196,000023287,000023292,000023294,000023297,000023299,000023300,000023312,000023319,000023320,000023322,000023324,000023325,000023326,000023327,000023328,000023331,6000001202,000023337,000023338,000023339,5000000362,000023340,000023341,000023342,000023343,000023345,000023346,000023347,000023349,000023350,000023352,000023355,000023360,000023376,000023396,000023451,000023465,000023466,000023469,000023470,000023472,5000000363,000023478,000023479,000023480,000023482,000023483,000023484,000023486,000023488,000023489,000023492,000023494,4000000654,000023498,000022925,000023506,000023507,000023510,6000001217,000023513,000023515,000023520,000023521,000023524,000023528,000023532,000023536,6000001316,000025518,000026204,6000001390,000026947,000026948,4000000734,000027673,000027772,000027936,000027990,6000001487,000028108,000028118,000028129,000028130,000028131,000028132,000028133,5000000445'
# ...
```

### Building a lookup
There is a lookup class for Categories, and one for product Attributes.

Expand Down