improve algo for search

Change-Id: Iad8cb40e69e3c795eef378a1abff42d9c1f5e985
Signed-off-by: li levi <levi.li@sap.com>