How does indexing works for $lookup

Please read Formatting code and log snippets in posts and re-post your pipeline so that it is easier to understand.