无法在Microsoft Azure认知搜索中达到第二个终结点

问题描述

我有一个简单的应用程序,该应用程序使用Microsoft Azure认知搜索来爬网2个表,一个.*表和一个$表。我将两个索引设置为完全相同的方式,并且尝试以相同的方式检索结果。 CASE WHEN REGEXP_MATCH(Source,"^.*(facebook|instagram).*$") THEN "Social" ELSE "Sonstige" END 搜索有效,但post每次在comment http请求上发布错误,并显示一条错误消息,内容为:

ERROR错误:未捕获(承诺):HttpErrorResponse:{“ headers”:{“ normalizednames”:{},“ lazyUpdate”:null,“ headers”:{}},“ status”:0,“ statusText” :“未知错误”,“网址”:“ https:// [search-uri] .search.windows.net / indexes / comment-view-index / docs?api-version = 2020-06-30”,“确定“:false,”名称“:” HttpErrorResponse“,”消息“:”针对https:// [search-uri] .search.windows.net / indexes / comment-view-index / docs?api-version的Http错误响应= 2020-06-30:0未知错误“,”错误“:{” isTrusted“:true}}

以下是URI的构造方式:

post

以下是服务电话:

comment

在这里被称为

OPTIONS

我可以通过Postman中的public static searchUri = `https://${ServerDetails.searchServiceName}.search.windows.net/indexes/${ServerDetails.searchIndexName}/docs?api-version=${ServerDetails.apiVersion}`; public static searchUriComment = `https://${ServerDetails.searchServiceName}.search.windows.net/indexes/${ServerDetails.searchIndexNameComment}/docs?api-version=${ServerDetails.apiVersion}`; searchData(query: string): Observable<any> { let result: Observable<any> = null; const options = { headers: new HttpHeaders({ 'api-key': ServerDetails.searchServiceAdminApiKey,'Content-Type': 'application/json' }) }; result = this.http.post(ServerDetails.searchUri,JSON.stringify({ search: query }),options); return result; } searchDataComments(query: string): Observable<any> { let result: Observable<any> = null; const options = { headers: new HttpHeaders({ 'api-key': ServerDetails.searchServiceAdminApiKey,'Content-Type': 'application/json' }) }; result = this.http.post(ServerDetails.searchUriComment,options); return result; } 请求来访问这两个uri,但是在Postman中进行getSearchData(): Promise<any[]> { return new Promise((resolve,reject) => { this.serv.searchDataComments(this.searchTerm).subscribe(data => { this.data = data.value; this.dataOnChanged.next(this.data); resolve(this.data); },reject); }); } 调用的所有尝试均失败。 两个索引上的所有原点都允许使用GET

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)