# How to filter field return

**URL:** <https://discuss.elastic.co/t/how-to-filter-field-return/171334>\
**Category:** Elasticsearch\
**Created:** [March 7, 2019, 2:52pm UTC](https://discuss.elastic.co/t/how-to-filter-field-return/171334 "2019-03-07T14:52:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Guirro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiago_guirro/32/41784_2.png) [@Tiago\_Guirro](https://discuss.elastic.co/u/Tiago_Guirro)\
**Post date:** [March 7, 2019, 2:52pm UTC](https://discuss.elastic.co/t/how-to-filter-field-return/171334/1 "2019-03-07T14:52:59Z")

</div>

I have a data structure by product, in which it has an array with multiple positions, but I need to limit, returning only those that match the search conditions.

{  
"idproduto": 11512,  
"idgradex": 3,  
"idmarca": 3,

```
                "precosaldo": [
                    {
                        "saldo_receber": 0,
                        "saldo_liquido": 35,
                        "idgrupopreco": 58,
                        "gradey": "110 VOLTS",
                        "idfilial": 10001,
                        "idfilialsaldo": 10001,
                        "idgradey": 1,
                        "precovenda": 2441.9
                    },
                    {
                        "saldo_receber": 0,
                        "saldo_liquido": 35,
                        "idgrupopreco": 61,
                        "gradey": "110 VOLTS",
                        "idfilial": 10001,
                        "idfilialsaldo": 10001,
                        "idgradey": 1,
                        "precovenda": 2639.9
                    },
                    {
                        "saldo_receber": 0,
                        "saldo_liquido": 35,
                        "idgrupopreco": 63,
                        "gradey": "110 VOLTS",
                        "idfilial": 10001,
                        "idfilialsaldo": 10001,
                        "idgradey": 1,
                        "precovenda": 2639.9
                    },
                    {
                        "saldo_receber": 0,
                        "saldo_liquido": 35,
                        "idgrupopreco": 65,
                        "gradey": "110 VOLTS",
                        "idfilial": 10001,
                        "idfilialsaldo": 10001,
                        "idgradey": 1,
                        "precovenda": 2441.9
                    },
                    {
                        "saldo_receber": 7,
                        "saldo_liquido": 5,
                        "idgrupopreco": 258,
                        "gradey": "220 VOLTS",
                        "idfilial": 140001,
                        "idfilialsaldo": 140001,
                        "idgradey": 2,
                        "precovenda": 2659.9
                    }
					]
					}

```

I need it to return from the precosaldo only what corresponds with the terms of my research.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 4, 2019, 2:53pm UTC](https://discuss.elastic.co/t/how-to-filter-field-return/171334/2 "2019-04-04T14:53:02Z")

</div>

Closed on April 4, 2019, 2:53pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
