Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71036

Consider resolving variables inside $search before forwarding to mongot

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Integration

      Currently if a variable occurs in a $search stage, we do nothing to interpret it and send it as a string to Lucene. We should discuss transforming

      {
        $search: {
          index: 'default',
          text: {
            query: '$$name',
            path: 'name'
          }
        }
      } 

      to

      {
        $search: {
          index: 'default',
          text: {
            query: 'Jacob',
            path: 'name'
          }
        }
      }
       

      for each document. We would also need to track the variable usage within the stage to ensure correctness.

      Note that there would be no plans to evaluate field references so single-dollar-sign-prefixed names would not be resolved. '$name' would not result in a per-document value but instead would continue to produce the literal string '$name'.

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            jacob.evans@mongodb.com Jacob Evans
            Votes:
            4 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated: