Auth0 Home Blog Docs

The query (_missing_:logins_count OR logins_count:0) is not working on users search?

user-search

#1
(_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?


#2

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 so this may be connected. Did your issue just occurred or have you noticed for some time now and only posted the question now?


#3

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.


#4

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.


#5

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.


#6

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) 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.


#7

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!


#8

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!


#9