# The query (\_missing\_:logins\_count OR logins\_count:0) is not working on users search?

**URL:** <https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451>\
**Category:** Get Help\
**Tags:** user-search\
**Created:** [October 11, 2017, 5:39pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451 "2017-10-11T17:39:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesacres](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jamesacres](https://community.auth0.com/u/jamesacres)\
**Post date:** [October 11, 2017, 5:39pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/1 "2017-10-11T17:39:59Z")

</div>

```
(_missing_:logins_count OR logins_count:0) 

```

Seems this no longer works for users search, which has broken some things for us which rely on finding those who have just registered.

Is this intended, and is there a workaround?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 11, 2017, 5:51pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/2 "2017-10-11T17:51:31Z")

</div>

There are some restrictions imposed on user search over some fields, but those restrictions when applicable should not include the `logins_count`. We are also investigating an increase in user search errors as per noted in this [incident](https://status.auth0.com/incidents/zg2rztjlnpt1) so this may be connected. Did your issue just occurred or have you noticed for some time now and only posted the question now?

---

<div class="post-metadata">

**Author:** ![jamesacres](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jamesacres](https://community.auth0.com/u/jamesacres)\
**Post date:** [October 11, 2017, 5:56pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/3 "2017-10-11T17:56:25Z")

</div>

Hi I have only just noticed this problem, it was working fine over past few weeks but I don’t yet know the precise time it stopped working whether today or last week.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 11, 2017, 6:05pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/4 "2017-10-11T18:05:09Z")

</div>

I could reproduce it and I don’t think it’s related to the linked incident and more a possible issue around `_missing_`. I’ll try to get more information on this and we’ll keep you posted.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 11, 2017, 6:07pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/5 "2017-10-11T18:07:13Z")

</div>

Meanwhile, I did notice that `_exists` does not seem to have an issue so you may consider changing your query to `NOT _exists_:logins_count`.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 11, 2017, 6:19pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/6 "2017-10-11T18:19:54Z")

</div>

As part of a somewhat recent user search incident there was an update on the infrastructure used to drive the functionality and that seems to have caused some changes in the syntax supported to make the queries. In particular, in the latest version of ElasticSearch the `_missing_` option is no longer supported (per the [notes here](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_search_changes.html#_deprecated_queries_removed)) and the recommendation is indeed to **use a negated exists `NOT _exists_:[target_field]`**.

I will also make sure that our own documentation is updated so that it no longer mentions the use of `_missing_ ` and instead suggest the use of the negated exists. Also, if you can confirm that the negated exists works for you that would be great as I only did a quick test with it.

---

<div class="post-metadata">

**Author:** ![jamesacres](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jamesacres](https://community.auth0.com/u/jamesacres)\
**Post date:** [October 11, 2017, 7:35pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/7 "2017-10-11T19:35:19Z")

</div>

Many thanks @jmangelo , using `NOT _exists_` instead of `_missing_` solves the problem, hopefully all documentation can be updated to help others with this issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![jamesacres](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jamesacres](https://community.auth0.com/u/jamesacres)\
**Post date:** [October 11, 2017, 7:35pm UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/8 "2017-10-11T19:35:19Z")

</div>

Many thanks @jmangelo , using `NOT _exists_` instead of `_missing_` solves the problem, hopefully all documentation can be updated to help others with this issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/the-query-missing-logins-count-or-logins-count-0-is-not-working-on-users-search/8451/9 "2018-03-02T05:56:55Z")

</div>


