Processing Query and returning similar documents using Hamming Distance