improved encoding on search