Large Metadata Search Returns No Results

Overview

When attempting to search for users based on values stored in app_metadata or user_metadata, the query may fail to return results if the stored data is very large. 

Applies To
  •  user search
  • metadata, 
  • search limitations
  • user metadata
  • app_metadata,
  • query performance
  • search best practices
Cause

According to Auth0 documentation, if the total amount of data in a user profile (including both app_metadata and user_metadata) exceeds 1 MB, that user record may not be retrievable through search. Additionally, any individual attribute values larger than 256 characters within these metadata fields are not searchable or returned in search results.

The User Search Best Practices documentation advises against storing very large or complex metadata fields that are intended for searching, as this can lead to indexing limitations or search timeouts.

For reference, see the following Auth0 documentation:

Solution

To ensure reliable search results and stay within search limitations, it is recommended to optimize how large data is stored and queried in metadata.

You can apply one of the following approaches:

  • Shorten: Use a mechanism to reduce the size or truncate the searchable field.

  • Filter in application code: Retrieve users based on related criteria (for example, all users that contain a specific metadata attribute e.g app_metadata.haslargevalue is True and then perform detailed matching or filtering within your application logic.

 

Recommended content

No recommended content found...