A female police officer has been airlifted to hospital after she was allegedly attacked with a sword.