Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13816

[Atlas Search] Document how to index arrays in Atlas Search

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: FTS
    • Last comment by Customer:
      true
    • Story Points:
      3
    • Sprint:
      CET: Deneb (8/25 - 8/31/20)

      Description

      Description

      In Tutorial: Create and Query an Atlas Search Index we provide an example that indexes an array, but do not explicitly call out that we are indexing an array. We have received a number of questions on how to index arrays using Atlas Search. So customers are not finding this example. We should add a section on how to index arrays using Atlas Search. For reference the following explanation was provided to customers, which they found helpful:

      For example, in the sample_mflix database, movies contain a genres array. (Only showing title and genres to highlight that genres is an array of strings.)

      {
        "title" : "The Final Countdown",
        "genres" : [ "Action", "Sci-Fi" ]
      }
      

      We then define an index on genres, once again focusing on the genres portion of the index definition:

            "genres": {
              "type": "string",
              "analyzer": "lucene.standard"
            },
      

      Note how the type is string and not array, array[string], string[], or some other syntax. We define the index as the data type of the array elements and do not have to specify that the data is contained in an array. The fact that it is an array is automatically detected and handled by MongoDB.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

        Attachments

          Activity

            People

            Assignee:
            kanchana.sekhar Kanchana Sekhar
            Reporter:
            james.kovacs James Kovacs
            Participants:
            Last commenter:
            Kanchana Sekhar Kanchana Sekhar
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              1 year, 12 weeks, 5 days ago
              Date of 1st Reply: