I have been reading Designing Data-Intensive Applications lately. In Chapter 6 on partitioning (sharding), the author talks about the need for secondary indexes in storage systems. In particular, the author says:
And finally, secondary indexes are the raison d’être of search servers such as Solr and Elasticsearch.
I'm quite confused about this. I think search engines use inverted index instead of forward index, which effectively creates index on each word instead of on some primary key of documents. So why is secondary index needed at all?