Refactor search code
indexed test
Minor refactoring
Prevent indexing already indexed repo