Open your System Pref. Go to Spotlight. Go to Privacy. Add your hard drive to privacy. This will stop Spotlight from indexing and perhaps allow encryption to complete. Once encryption is complete, turn Spotlight back on by removing the hard drive from Privacy.
If by any chance you have more than one user on your computer, you should exclude the home folder of the second user from Spotlight while logged in as the first. There is a bug in El Capitan that can cause Spotlight to get stuck indexing if you don't.