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

Consider resolving variables inside $search before forwarding to mongot

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Query Integration

    Description

      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'.

      Attachments

        Activity

          People

            backlog-query-integration Backlog - Query Integration
            jacob.evans@mongodb.com Jacob Evans
            Votes:
            4 Vote for this issue
            Watchers:
            21 Start watching this issue

            Dates

              Created:
              Updated: