first algorithm for the search using dots on json