Hi!
What you can do is to create a udev rule to disable/enable the indexer when the cord is unplugged/plugged. As an example, I’ll post a rule I used to set CPU governor before I started using TLP. You just need to remove the comment symbol and change the script path for the lines you need.
[mbb@mbb-laptop ~]$ cat /etc/udev/rules.d/98-ACDC-behaviour.rules
# Set governor to powersave and disable turbo boost on DC (handled by tlp)
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/cpugov-powersave.sh"
# Set governor to performance and enable turbo boost on AC (handled by tlp)
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/cpugov-performance.sh"
# Set software energy policy hint to 10 on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/x86-energy-policy-power.sh"
# Set software energy policy hint to 4 on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/x86-energy-policy-performance.sh"
# Set gpu max frequency to 750 Mhz on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/set_gpu_frequency_power.sh"
# Set gpu frequencies to defaults on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/set_gpu_frequency_performance.sh"
# Set turbo boost off on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/set_turboboost_off.sh"
# Set turbo boost on on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/set_turboboost_on.sh"
# Set cpu max frequency to 1200 Mhz on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/set_cpu_frequency_power.sh"
# Set cpu frequencies to defaults on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/set_cpu_frequency_performance.sh"