If you were to watch the database communication during a query with Fiddler, or request the RavenQueryStatistics in your query like this...
RavenQueryStatistics stats;
var result = session.Query<Location>()
.Customize(x => x.WaitForNonStaleResultsAsOfNow())
.Statistics(out stats)
.Where(l => l.Name = "Home" && !l.Deleted);
Then you would see properties like:
- IsStale
- Timestamp - when the query results were un-stale
- IndexName - the index being queried
- IndexTimestamp
- IndexEtag - the document version corresponding to the last document updated in the index
- Other things related to paging, etc.
This is the information that WaitFor(several variants) uses to determine if it should be satisfied or not.
So, the TL;DR answer is: just the one index that is being queried. It would be wasteful to check all of the indexes.
So for WaitForNonStaleResultsAsOfNow, it says OK, let's grab DateTime.Now, and then not return results until IndexTimestamp >= that date.
These WaitFor- methods are somewhat of an anti-pattern - you shouldn't rely on them exclusively to get consistent results, you should probably (in some cases, but not all) redesign your UI or your data model so that you are using Load/Store by document id (where ACID is guaranteed) where you need consistency.
But, looking at how it does it, you can see that it might be a better idea to use WaitForNonStaleResultsAsOfLastWrite, which causes the Raven client to note the last document E-Tag that it stored, and wait for that IndexETag to be incorporated in the index. This is especially true for a "Insert data, then show in updated grid" scenario. You don't need to wait for ALL the indexing to be done, you just want to be sure that the one thing you just inserted will appear.