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

Include Index Parameter

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.23.0
    • Affects Version/s: 1.22.0
    • Component/s: Aggregation pipeline
    • Labels:
      None
    • Not Needed
    • Iteration Lime

      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.

       

        1. Compass Search Stage.mov
          32.10 MB
          Marcus Eagan

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

              Created:
              Updated:
              Resolved: