refactored project index controller db query

Signed-off-by: Lori Moehn <lmoehn@gmail.com>