RestComm / Restcomm-Connect

The Open Source Cloud Communications Platform
http://www.restcomm.com/
GNU Affero General Public License v3.0
242 stars 215 forks source link

Logs search should match partial results by default #2926

Closed ammendonca closed 6 years ago

ammendonca commented 6 years ago

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:

ammendonca commented 6 years ago

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

https://github.com/RestComm/Restcomm-Connect/blob/55a3f8ab8e111931c4f8c221330c8dc6dc2ebff3/restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/entities/CallDetailRecordFilter.java#L59-L64

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.

ammendonca commented 6 years ago

CC @RestComm/vvs-squad