optimize search plugin