How to index nested JSON arrays with Azure AI Search?

Robert Myers 15 Reputation points
2024-02-07T17:16:29.6566667+00:00

Hi all,

I have a question relating to Azure AI Search and Azure OpenAI. I've pasted below a simple json data structure containing nested arrays. I am having trouble setting this up so that the nested 'interests' arrays are indexed/searchable. The name field works fine, but the nested array is just simply being ignored.

[
  {
    "name": "Zoe",
    "interests": [
      "tennis",
      "swimming"
    ]
  },
  {
    "name": "Reena",
    "interests": [
      "community manager",
      "clothes"
    ]
  },
  {
    "name": "Clive",
    "interests": [
      "clothes",
      "tennis",
      "swimming"
    ]
  },
  {
    "name": "Rob",
    "interests": [
      "running"
    ]
  }
]

These are the steps I've followed up to now:

  1. Upload json file with data above to a blob storage container in Azure
  2. Navigate to my Azure AI Search service/instance and import data from the blob container
  3. For the index setup I select all fields to be retrievable, filterable and searchable.
  4. For the indexer setup I set parsing mode to JSON array, leaving the document root field blank.
  5. All of these steps proceed fine.
  6. I load this data source (using the ai search instance, and index setup above) into my ChatGPT 4 model via the Chat Playground.
  7. I can't seem to grab/query any data from the 'interests' arrays.
  8. when i try to use a custom field mapping the 'interests' field is not even listed, only the name field is.

Can anyone advise as to what steps I'm missing in order for the interests arrays to be taken into account.

Regards,

Rob

Sample data = sample.txt

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
831 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,538 questions
{count} votes