# Wrong filter section design

**URL:** <https://discuss.dgraph.io/t/wrong-filter-section-design/3461>\
**Category:** Users\
**Created:** [October 22, 2018, 4:03pm UTC](https://discuss.dgraph.io/t/wrong-filter-section-design/3461 "2018-10-22T16:03:57Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![makitka](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/makitka/32/1307_2.png) [@makitka](https://discuss.dgraph.io/u/makitka)\
**Post date:** [October 29, 2018, 4:38pm UTC](https://discuss.dgraph.io/t/wrong-filter-section-design/3461/10 "2018-10-29T16:38:54Z")

</div>

found very weird but working workaround. it uses edge with facets, filtering on facets doesn’t require index and is not performing redundant and slow lookups. the edge is pointing from node to itself (since filtering on value edge facets is not supported):

```auto
entity_key: string @index(exact) .

_:node <entity_key> "entity1" .
_:node <attrs> _:node (name="Nikita", sex="m") .

{
	get_entity(func: eq(entity_key, "entity1")) @cascade {
		uid
		attrs @facets(eq(name, "Nikita") and eq(sex, "m")) @facets(name, sex) # male
	}
}

{
    "data": {
        "get_entity": [
            {
                "uid": "0x1",
                "attrs": [
                    {
                        "attrs|name": "Nikita",
                        "attrs|sex": "m"
                    }
                ]
            }
        ]
    }
}

{
	get_entity(func: eq(entity_key, "entity1")) @cascade {
		uid
		attrs @facets(eq(name, "Nikita") and eq(sex, "f")) @facets(name, sex) # female now
	}
}

{
    "data": {
        "get_entity": []
    }
}

```

btw, seems like it’s not so hard to implement filtering by edge values since it’s already done for edge facet values.

---

_[View the full topic](https://discuss.dgraph.io/t/wrong-filter-section-design/3461)._
