Oak does not index as much content by default as does Jackrabbit 2. You need to create custom indexes when necessary, much like in traditional RDBMSs. If there is no index for a specific query, then the repository will be traversed. That is, the query will still work but probably be very slow.
There are 3 main types of indexes available in Oak. For other type (eg: nodetype) please refer to the query engine documentation page.
For more details on how indexing works (for all index types):