I don't believe there is a way to do generic bitwise stuff without scripts. On the other hand, depending on what you want to do you rewrite it to a range query or a bool query with multiple range queries in the should clause. That is likely to be more efficient in some cases than a script because it can use the terms dictionary instead of doc values.
Its likely possible for you to implement more queries to do bitwise stuff against the terms dictionary in a plugin but that is a reasonably involved project all on its own. If you want to learn and you desperately need the speed its something you can think about.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.