带有responseFilter ="Entities"的Bing Web Search Java SDK [英] Bing Web Search Java SDK with responseFilter="Entities"
问题描述
我正尝试使用Bing Web Search SDK for Java通过REST API中所述的responseFilter获取实体结果-https://docs.microsoft.com/zh-cn/rest/api/cognitiveservices /bing-web-api-v7参考.我有两个的订阅密钥 Bing Web服务和Bing实体服务.我想获得不知名人士的实体结果.我在以下针对SDK的查询中进行设置(我正在Scala中使用Java SDK)-
I am trying to use the Bing Web Search SDK for Java to get Entity results using the responseFilter as described in the REST API - https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-web-api-v7-reference. I have a subscription key for both Bing Web Service and Bing Entities Service. I want to get entity results for persons who are not well-known. I am setting up my query in the as follows for the SDK (I am using the Java SDK in Scala) -
val at = List(AnswerType.fromString("Entities")).asJava
val webData: SearchResponse = client.bingWebs().search()
.withQuery("""brian johnson "MITRE" (site:linkedin.com)""")
.withResponseFilter(at)
.withCount(10)
.execute()
当我使用此查询获取结果时,我得到一个NullPointerException(webData.webpages()= null),但是当我使用相同的查询参数直接向其余api发出HTTPS请求时,我得到了我想要的结果.有人可以帮我这个忙吗?
When I use this query to get results, I get a NullPointerException (webData.webpages() = null) but when I do an HTTPS request directly to the rest api with the same query parameters, as above, I get the results I want. Can someone help me out with this?
推荐答案
有关Bing搜索API的问题,请使用以下论坛:
For questions on the Bing search API, pls use these forums:
此致,
Jaya
Regards,
Jaya
这篇关于带有responseFilter ="Entities"的Bing Web Search Java SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!