Reputation: 337
We have set Metadata on Block Blob and are able to verify the Key/Value correctly stamped on the blob.
Out of many fields that have been defined in the index, only one field value (PromotionId) is not appearing in the indexed data, as can be confirmed by executing search through the "Search explorer".
This field has actually been mapped to the key "ID" in the indexer.
And has been defined in Index.
Why is the value of this specific field not appearing in the index? Rest all metadata fields are all appearing in the index as expected.
Upvotes: 0
Views: 605
Reputation: 376
The field mapping is not working because "ID" is specified as a sourceFieldName, but there is no ID property on the source Blob as it only exists on the Index you have defined.
This may be a bit confusing since it behaves like there is an "ID" property because the "ID" field is being populated without a field mapping. However, this is because Azure Search automatically maps the "metadata_storage_path" to whichever field is the document key when no field mapping for the document key is specified. This behavior is documented here.
If you want the PromotionId to be the document path like the ID field you can change the sourceFieldName to "metadata_storage_path" for the PromotionId field mapping. If you want to also be base64 encoded you can add the fieldMappingFunction to the field mapping as well.
Upvotes: 1