RestComm/Restcomm-Connect

Logs search should match partial results by default

Closed this issue · 2 comments

Is this a BUG REPORT or FEATURE REQUEST?:

/kind feature

What happened:

When searching for a log (calls, messages, etc) if we use only a part of the number it won't show any results (eg, searching with 512 won't show results like 512123456 or 123512456 or 123456512).

If we use %512% as the search expression it will match for any of those.

What you expected to happen:

Expect it to match with partial number.

How to reproduce it (as minimally and precisely as possible):

Perform a search with only a part of an existing number, and see it won't show.

Anything else we need to know?:

It should use the % by default to provide a better UX.

Environment:

  • Restcomm Connect version (from startup logs): RestcommONE Cloud

Additional tests showed that actually the backend is using %<pattern> when searching, thus, using 512 would match 123456512 but not the others.

// The LIKE keyword uses '%' to match any (including 0) number of characters, and '_' to match exactly one character
// Add here the '%' keyword so +15126002188 will be the same as 15126002188 and 6002188
if (recipient != null)
recipient = "%".concat(recipient);
if (sender != null)
sender = "%".concat(sender);

As a temporary fix, we'll make the UI add the trailing % automatically, but it should be discussed wether this should make part of the REST API or fully leave it to the user, not adding the leading % either.

CC @RestComm/vvs-squad