Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-4302

Default query for $search uses deprecated operator

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.22.0
    • Affects Version/s: 1.21.2
    • Component/s: Aggregation pipeline
    • Labels:
      None
    • Iteration Elderberry

      The current default query for $search is

      /**
       * search: Analyzed search.
       * term: Unanalyzed search.
       * compound: Combines ops.
       * span: Find in text field regions.
       * exists: Test for presence of a field.
       * near: Find near number or date.
       * range: Find in numeric or date range.
       */
      {
       search: {
       query: 'string'
       path: 'string'
       }
      }

      the search: operator has been deprecated.  It should be replaced with text:

      /**
       * text: Analyzed search.
       * term: Unanalyzed search.
       * compound: Combines ops.
       * span: Find in text field regions.
       * exists: Test for presence of a field.
       * near: Find near number or date.
       * range: Find in numeric or date range.
       */
      {
       text: {
       query: 'string',
       path: 'string'
       }
      }

      It's also missing a comma between the query option and the path option, which could be confusing.

            Assignee:
            massimiliano.marcon@mongodb.com Massimiliano Marcon
            Reporter:
            doug.tarr@mongodb.com Doug Tarr
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: