【问题标题】:Azure Search for Blob Storage is not working.Azure 搜索 Blob 存储不工作。
【发布时间】:2016-12-02 10:11:46
【问题描述】:

第 1 步:我在其中创建了一个通用 Blob 存储(块 blob)和一个容器(访问策略设置为“容器”)。还添加了 19 个文档(pdf、xlsx、docx、ppt、png、jpg、txt),所有文档都显示在 azure portal --> Blob Storage Container 中。

第 2 步:创建 Azure 搜索(基本层)并按照本文执行以下操作。

第 3 步:创建数据源

POST https://anysearch.search.windows.net/datasources?api-version=2015-02-28-Preview
Content-Type: application/json
api-key: adminkey

{
    "name" : "blob-datasource",
    "type" : "azureblob",
    "credentials" : { "connectionString" : "DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=givenkey==" },
    "container" : { "name" : "containername"}
} 

第 4 步:创建索引

POST https://anysearch.search.windows.net/indexes?api-version=2015-02-28-Preview
Content-Type: application/json
api-key: adminkey

{
    "name" : "my-target-index",
    "fields": [
        { "name": "id", "type": "Edm.String", "key": true, "searchable": false },
        { "name": "content", "type": "Edm.String", "searchable": true, "filterable": false, "sortable": false, "facetable": false }
    ]
}

第 5 步:创建索引器。

POST https://anyearch.search.windows.net/indexers?api-version=2015-02-28-Preview
Content-Type: application/json
api-key: adminkey

{
  "name" : "blob-indexer",
  "dataSourceName" : "blob-datasource",
  "targetIndexName" : "my-target-index",
  "schedule" : { "interval" : "PT5M" }
}

第 6 步:运行索引统计并得到以下结果 - DOCUMENTCOUNT = 0

GET https://anysearch.search.windows.net/indexes/my-target-index/stats?api-version=2015-02-28-Preview
api-key: [admin key]

{
  "@odata.context": "https://mydocsearch.search.windows.net/$metadata#Microsoft.Azure.Search.V2015_02_28_Preview.IndexStatistics",
  "documentCount": 0,
  "storageSize": 1728
}

第7步:搜索“进程”一词并得到以下结果

GET https://anysearch.search.windows.net/indexes/my-target-index/docs?api-version=2015-02-28&search=process

{
    "@odata.context": "https://mydocsearch.search.windows.net/indexes('my-target-index')/$metadata#docs(id,content)",
    "value": []
}

这里出了什么问题?为什么文档计数为 0 ?为什么“过程”一词或任何其他搜索词没有返回任何结果?

请帮忙。

谢谢

巴努。

【问题讨论】:

    标签: azure-blob-storage azure-cognitive-search


    【解决方案1】:

    您需要确保索引器成功运行,然后才能搜索文档。您可以在门户中或以编程方式监控索引器状态,这通常会告诉您为什么文档没有被索引。在您的情况下,容器具有不支持的 jpeg 和 png 文件(默认情况下,这种情况会停止索引器的执行)。请查看支持的格式列表here。

    【讨论】:

    • 这就像一个魅力!非常感谢。我认为索引器会忽略不支持的文件。感谢您指出。我从 blob 中删除了 jpeg 和 png 文件并再次运行索引器。它奏效了。
    • 很高兴听到这个消息。如果您希望索引器自动跳过不支持格式的文本提取(但仍提取一些存储元数据),请投票给UserVoice suggestion
    猜你喜欢
    • 2016-08-14
    • 2018-03-16
    • 2018-07-06
    • 2015-12-01
    • 2021-04-14
    • 2017-04-18
    • 2014-06-26
    • 1970-01-01
    • 2020-06-17
    相关资源
    最近更新 更多