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

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



    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • None
    • FTS
    • 3
    • CET: Deneb (8/25 - 8/31/20)
    • true



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




            kanchana.sekhar@mongodb.com Kanchana Sekhar
            james.kovacs@mongodb.com James Kovacs
            Kanchana Sekhar Kanchana Sekhar
            0 Vote for this issue
            4 Start watching this issue


              2 years, 5 weeks, 2 days ago