text index with compare (scala)