Search refactor (replaced tag_string with general key, preparation for reverse search)