Added search optimization to search only documents where the query terms occur