Getting keys from a View is O(n) and not O(1)

Let me rephrase.
I want to use views for lookups (like in the beer example above). The view works offline preparing the relevant doc ids and when need arise, I call the view with a specific key and the view should return the pre-calculated IDs.
The return duration should be independent of the database size as it was already calculated.
Thus, reading the view should be as fast as accessing a single key and not a function of the return dataset size