# \[Painless\] Filtering an entry set has no effect

**URL:** <https://discuss.elastic.co/t/painless-filtering-an-entry-set-has-no-effect/114687>\
**Category:** Elasticsearch\
**Created:** [January 9, 2018, 10:48am UTC](https://discuss.elastic.co/t/painless-filtering-an-entry-set-has-no-effect/114687 "2018-01-09T10:48:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbismuth](https://avatars.discourse-cdn.com/v4/letter/c/9e8a1a/32.png) [@cbismuth](https://discuss.elastic.co/u/cbismuth)\
**Post date:** [January 9, 2018, 10:48am UTC](https://discuss.elastic.co/t/painless-filtering-an-entry-set-has-no-effect/114687/1 "2018-01-09T10:48:04Z")

</div>

Hi,

The filter stage in the code below has no effect (i.e. long values are not filtered).

Does anyone else encountered this issue with Elasticsearch 6.1.1?

```
long myId = 1;
myMap
    .entrySet()
    .stream()
    .filter(e -> ((Long) e.getKey()).longValue() != myId)
    .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));

```

Thanks,  
Christophe

---

<div class="post-metadata">

**Author:** ![Jack\_Conradson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_conradson/32/47236_2.png) [@Jack\_Conradson](https://discuss.elastic.co/u/Jack_Conradson)\
**Post date:** [January 12, 2018, 5:17pm UTC](https://discuss.elastic.co/t/painless-filtering-an-entry-set-has-no-effect/114687/2 "2018-01-12T17:17:19Z")

</div>

Hi Christophe,

Would you mind posting what values are actually in the Map you're using? If the values are what you expect I may be able to add a test locally on my end to see what's going on. You may be able to use Debug.explain ([https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-debugging.html](https://www.elastic.co/guide/en/elasticsearch/painless/master/painless-debugging.html)) to print the contents if you haven't already.

Thanks,  
Jack

---

<div class="post-metadata">

**Author:** ![cbismuth](https://avatars.discourse-cdn.com/v4/letter/c/9e8a1a/32.png) [@cbismuth](https://discuss.elastic.co/u/cbismuth)\
**Post date:** [January 25, 2018, 4:26pm UTC](https://discuss.elastic.co/t/painless-filtering-an-entry-set-has-no-effect/114687/3 "2018-01-25T16:26:24Z")

</div>

Sorry Jack, I didn't your answer notification, issue was on our side.

Thank you,  
Christophe

---

<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:** [February 22, 2018, 4:26pm UTC](https://discuss.elastic.co/t/painless-filtering-an-entry-set-has-no-effect/114687/4 "2018-02-22T16:26:31Z")

</div>

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