DRY refactoring of tickets search and index