【发布时间】: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