Why does search fail with error 2012 "must be a number" on a text attribute?

Problem

  • Global search or typeahead in the Reltio UI returns no results or suggestions for some users, while the same search works for others.
  • The search request (POST {TenantURL}/entities/_search) fails with error code 2012 "Invalid request parameter 'filter'", and the details say The filter on attributes.<Attribute>... must be a number.
  • The error can name an attribute that the search didn't filter on directly, for example in a search across all attributes such as containsWordStartingWith(attributes,'<text>').

Cause

The attribute's type in the search index no longer matches the tenant configuration. This typically happens when an existing attribute's type is changed, for example from a numeric type to String, and the index keeps the earlier numeric type. Search then rejects any text value compared with that attribute. Changing the type of an existing attribute is one of the configuration changes after which Reltio documents a full-tenant reindex with enableSeparateIndexing=true.

A search across all attributes doesn't always evaluate that attribute, which is why the error can appear for some users and searches and not for others.

Diagnose

{TenantURL} is https://<environment>.reltio.com/reltio/api/<tenantId>.

  1. Filter on the attribute directly, as any user:

     POST {TenantURL}/entities/_search
     Authorization: Bearer <access_token>
     Content-Type: application/json
    
     { "filter": "equals(attributes.<Attribute>,'<a value stored on a profile>')", "max": 1 }

    The cause applies if this returns the same "must be a number" error, even for a value that profiles store.

  2. In the configuration (GET {TenantURL}/configuration), check that the attribute's type is now a text type such as String.

Solution

  1. Run the Reindex Data task for the whole tenant with separate indexing:

    POST {TenantURL}/reindex?enableSeparateIndexing=true&distributed=true

    The task builds a new index from the current configuration. Search keeps using the current index until the new one replaces it.

  2. Don't use enableSeparateIndexing together with entityType or a list of entities, and don't change the tenant configuration while the task runs.

Verify

After the task completes, the Diagnose step 1 request returns results, and the users who couldn't search find the record from global search.

Prevent

Whenever you change an existing attribute's type, or make another change that the Reindex Data Task page lists, run the full reindex with enableSeparateIndexing=true.

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.