refactored search services and clearing session on publish