Create serach index lucene.whitespace for fields in an array

I want to create an index in atlas for some files, and one of them is an array items, with some fileds. This is the json.

{
  "mappings": {
    "dynamic": false,
    "fields": {
      "client": {
        "analyzer": "lucene.whitespace",
        "searchAnalyzer": "lucene.whitespace",
        "type": "string"
      },
      "items": {
        "dynamic": true,
        "fields": {
          "item1": {
            "analyzer": "lucene.whitespace",
            "searchAnalyzer": "lucene.whitespace",
            "type": "string"
          },
          "item2": {
            "analyzer": "lucene.whitespace",
            "searchAnalyzer": "lucene.whitespace",
            "type": "string"
          }
        },
        "type": "embeddedDocuments"
      },
      "shipping_code": {
        "analyzer": "lucene.whitespace",
        "searchAnalyzer": "lucene.whitespace",
        "type": "string"
      }
    }
  }
}

I wnand to search for these fields, for this reason I use dynamic: false, so I’ve added this json in atlas search in JSON editor and i don’t get results for item1, item2, for the items of the
array. Is the json ok?, is something missing in the json?

Hi @javier_ga,

Can you provide the following details so that I can better assist:

  1. Several sample document(s) you are searching on
  2. The $search query performed
  3. Expected output based on the sample documents

Regards,
Jason

already solved, changing “type”: “embeddedDocuments” to “type”: “document”

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.