Yes, the term index does make sense for these predicates, and they will have to be created for
anyofterms to be usable. There are a few switches in dgraph alpha around memory. Here is the relevant output from dgraph alpha --help. The general tradeoff is between memory and performance i.e. better performance requires more memory.
--badger.tables string [ram, mmap, disk] Specifies how Badger LSM tree is stored. Option sequence consume most to least RAM while providing best to worst read performance respectively. (default "mmap")
--badger.vlog string [mmap, disk] Specifies how Badger Value log is stored. mmap consumes more RAM, but provides better performance. (default "mmap")