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

Include Index Parameter

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.23.0
    • 1.22.0
    • Aggregation pipeline
    • None
    • Not Needed
    • Iteration Lime

    Description

      The template for the $search stage can be difficult to get started with because the index is missing from the template, yet it is still required. The name of the search index is defined at creation.

       

      If we re-add that template, it will be easier for developers to comprehend. Here is an example:

       /** 
      * index: the name of the Search index. 
      * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search. 
      * term: Un-analyzed 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. 
      */
      {
        index: 'movies',
        text: {
          query: 'base',
          path: 'plot'
        }
      }

       

       

       I've attached a video to make the explanation easier.

       

      Attachments

        Activity

          People

            massimiliano.marcon@mongodb.com Massimiliano Marcon
            marcus.eagan@mongodb.com Marcus Eagan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: