title: How to index this couchbase query
body: <p><strong>I am try to index this query but I don't how to do so</strong></p>
  <pre><code>const query = `SELECT r.*, r.itemName as name, r.createdBy.timestamp AS modifiedOn
                 FROM report r
                 LET groupReportIds = (SELECT rg.reportGuid
                        FROM report rg
                        WHERE rg.eventType = 'GROUP_SHARING' AND LOWER(rg.userEmail) = LOWER(&quot;${email}&quot;))
                 WHERE (ANY u in groupReportIds SATISFIES u.reportGuid = r.details.guid  END)`;
  </code></pre>