For the purpose of measuring the strain field in nanoscale structures according to the change of photoluminescence(PL) from quantum dots(QDs), we have reported the enhancement and quench of PL from In_<0.5>Ga_<0.5>As QDs embedded in GaAs during nanoprobe indentation. With the increase of indentation force, the intensity of PL from QDs increased for more than 3 times firstly and then decreased when the forces increased further. Finally, the PL from QDs was totally quenched by the indentation force larger than a critical value. To clarify the mechanism, the simulation work were done based on the finite element method and strain-dependent k.p Hamiltonian. Results revealed that the hole accumulation was responsible for the PL enhancement while the crossover of energy bands caused the quench of PL.