Dielectronic recombination and its applications in astronomy