Efficient and Scalable Handwritten Word Spotting on Historical Documents using Bag of Visual Words