Entity Search API returns no results when filter uses 'contains' and search string has a space


Calling Search API with filter 'contains(attributes.Address.City, "Jersey City")' returns no results, but when search string has no spaces (e.g., for a value like 'JerseyCity'), results are returned with 'contains'.

Using 'equals' instead of 'contains' also returns results correctly.

API used: /entities?filter=(contains(attributes.Address.City, "Jersey City"))&select=uri&max=5


The "equals" filter description is - (property, value). This means it filters all the conditions with the exact match while ignoring the case (because it is case insensitive), so the API generates correct output with that filter.

However, the "contains" filter --> (attributes.Identifiers.ID, *value or ?value) is described as "Passed" if attributes.Identifiers.ID satisfies a wildcard record.

Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character (case insensitive)." 

The "contains" filter is not designed to have space in its search section, because it only takes specific words as input which is a part of the actual word. The contain filter parses any word that you pass as an input as a value which is a part of another actual value.



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



Please sign in to leave a comment.