Fix query error in smart search tags plugin