Database set up and search stats tracking