0
步骤1:我在其中创建了一个通用Blob存储(块blob)和一个容器(访问策略设置为“容器”)。还添加了19个文档(pdf,xlsx,docx,ppt,png,jpg,txt),并且所有文档都显示在azure门户 - > Blob存储容器中。Azure搜索Blob存储无法使用。
第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?为什么“过程”或其他搜索词没有返回任何结果?
请帮忙。
谢谢
Bhanu。
这就像一个魅力工作!非常感谢。我认为索引器会忽略不支持的文件。感谢您指出。我从blob中删除了jpeg和png文件,然后再次运行索引器。有效。 – Bhanu
非常感谢。如果您希望索引器针对不支持的格式自动跳过文本提取(但仍提取一些存储元数据),请为此[UserVoice建议]投票(https://feedback.azure.com/forums/263029-azure-search/建议/ 15094944二进制大对象,索引,应该-继续索引的文档-AF) –