A hidden vector encryption (HVE) scheme, one type of predicate encryption schemes, can support comparison predicates on encrypted keywords through encrypted predicates by pairing transformed keyword vectors with predicate vectors. However, the length of these vectors grows in proportion to the size of the keyword space and so does the system complexity. In this paper, we provide a privacy-preserving encoding for efficient comparison queries, where the length of the vectors and the system complexity is only logarithmically proportional to the size of the keyword space. In addition, our encoding integrates a HVE scheme and a ciphertext-policy attribute based encryption (CPABE) scheme. This integration provides not only the access control based on the searchable keywords but also balanced overheads among encryption, key generation and query for both computation and storage overheads.