Search code examples
metadataazure-cognitive-search

Blob custom metadata gives null on search


I am trying to use blob custom metadata in my azure search. I have tried loads of multiple ways but my result keeps giving me null.

After many tried, at this moment I have configured the following (which isnt working!): Blob storage with custom metadata: pageurl =

In the index I have configured the following:

    {
      "name": "metadata_storage_pageurl",
      "type": "Edm.String",
      "searchable": true,
      "filterable": true,
      "retrievable": true,
      "sortable": true,
      "facetable": false,
      "key": false,
      "indexAnalyzer": null,
      "searchAnalyzer": null,
      "analyzer": null,
      "normalizer": null,
      "dimensions": null,
      "vectorSearchProfile": null,
      "synonymMaps": []
    },

In the indexer:

    "configuration": {
      "dataToExtract": "contentAndMetadata",
      "parsingMode": "default"
    }

    {
      "sourceFieldName": "metadata_storage_pageurl",
      "targetFieldName": "pageurl",
      "mappingFunction": null
    }

In the skillset:

          {
            "name": "metadata_storage_pageurl",
            "source": "/metadata_storage_pageurl",
            "sourceContext": null,
            "inputs": []
          }

What would I need to do to ensure that a search actually provides the blob custom metadata?

What I have tried is to mix between:

  • metadata_storage_pageurl or just pageurl
  • Using /document/ infront of it.
  • Many other things.

Solution

  • Did you try "/document/metadata_pageurl" in your skillset index projections definition? So with the "/document" but without "storage". That should be what works.

    My bad, you don't need "metadata_". The source in your index projections definition should just be "/document/pageurl".

    You need to ensure that the name in the index projections matches the name of the field in the index. So if you update one you have to update the other. I would then remove the fieldMappings in the indexer definition (that is for the "parent" index, which if you are using index projections I'm guessing isn't your primary index) as having it might cause some other weird mappings and renames to happen, since fieldMappings are applied before skillset execution.