Azure Blob 索引器:元数据中的 DateTimeOffsets

Azure Blob Indexer: DateTimeOffsets in metadata

我正在使用 Azure 搜索 Blob 索引器的预览版。所有被索引的数据都包含在 blob 的元数据中。因此,我将 AzureSearch_SkipContent 设置为 'true' 以防止内容索引。

我无法使 DateTimeOffset 字段正常工作,因为我无法确定将 DateTimeOffset 值存储为的正确格式。

当我创建索引器时,我收到错误响应 (400 Bad Request),响应正文包含以下内容:

{"error":{"code":"","message":"Column 'ProcessDT' is of type String that is not compatible with the field of type Edm.DateTimeOffset in the index"}}

我尝试了各种字符串格式(我测试的blob上的值是

2015-01-03T11:13:00.000+01:00

所以它应该对应于与 OData 4.0 兼容的格式,因此 azure 搜索如下所述:https://msdn.microsoft.com/en-us/library/azure/dn798938.aspx

目前不支持将字符串转换为 DateTimeOffset 字段值。我们认识到这是一个痛苦的限制,并将在不久的将来解决这个问题。作为部分解决方法,您可以将这些值索引为字符串(这样您就可以根据需要设置它们的格式并仍然使用它们进行搜索和过滤)。 感谢您提出这个问题!