请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AzureSearchWebResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.billylieurance.azuresearch.AzureSearchWebResult的典型用法代码示例。如果您正苦于以下问题:Java AzureSearchWebResult类的具体用法?Java AzureSearchWebResult怎么用?Java AzureSearchWebResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AzureSearchWebResult类属于net.billylieurance.azuresearch包,在下文中一共展示了AzureSearchWebResult类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fromQuery2Weblist

import net.billylieurance.azuresearch.AzureSearchWebResult; //导入依赖的package包/类
public static List<String[]> fromQuery2Weblist(String query) {
	List<String[]> ret = new ArrayList<String[]>();
	AzureSearchWebQuery aq = new AzureSearchWebQuery();
	aq.setAppid("POQ8S/XONvSFxnUFrKANXTadRVzDAMN2E2cnCXmPOSM=");// 50,000
																// transactions
	// aq.setAppid("D4Makeg91kNY0ZuZ4SJBfNKQ69m/ay/VVwa+9NLTAIw=");//free
	// 5000 transactions
	aq.setQuery(query);
	aq.doQuery();
	AzureSearchResultSet<AzureSearchWebResult> ars = aq.getQueryResult();

	for (AzureSearchWebResult nsr : ars) {
		ret.add(new String[] {
				nsr.getUrl(), nsr.getTitle(),
				nsr.getDescription() });
	}
	return ret;
}
 
开发者ID:zhangcongle,项目名称:NewsSpikeRe,代码行数:19,代码来源:BingAzureApi.java


示例2: buildQueryResult

import net.billylieurance.azuresearch.AzureSearchWebResult; //导入依赖的package包/类
/**
 *
 */
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildQueryResult() {
    AzureSearchWebQuery aq = new AzureSearchWebQuery();
    aq.setBingApi(AZURESEARCH_API.BINGSEARCHWEBONLY);
    aq.setAppid(AzureAppid.AZURE_APPID);
    aq.setQuery("Oklahoma Sooners");

    logURL(aq);

    aq.doQuery();
    Document ad = aq.getRawResult();
    Assert.assertNotNull(ad);

    AzureSearchResultSet<AzureSearchWebResult> ars = aq.getQueryResult();
    Assert.assertNotNull(ars, "getQueryResult returned null");
    Assert.assertNotNull(ars.getASRs(), "getQueryResult.getASRs returned null");
    Assert.assertFalse(ars.getASRs().isEmpty(), "getQueryResult returned no results");

    asr = ars.getASRs().get(0);
    Assert.assertNotNull(asr, "Unparseable result from result.");

}
 
开发者ID:peculater,项目名称:azure-bing-search-java,代码行数:26,代码来源:AzureSearchWebOnlyTest.java


示例3: buildQueryResult

import net.billylieurance.azuresearch.AzureSearchWebResult; //导入依赖的package包/类
/**
 *
 */
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildQueryResult() {
    AzureSearchWebQuery aq = new AzureSearchWebQuery();
    aq.setAppid(AzureAppid.AZURE_APPID);
    aq.setDebug(true);
    aq.setQuery("Oklahoma Sooners");

    logURL(aq);

    aq.doQuery();
    Document ad = aq.getRawResult();
    Assert.assertNotNull(ad);

    AzureSearchResultSet<AzureSearchWebResult> ars = aq.getQueryResult();
    Assert.assertNotNull(ars, "getQueryResult returned null");
    Assert.assertNotNull(ars.getASRs(), "getQueryResult.getASRs returned null");
    Assert.assertFalse(ars.getASRs().isEmpty(), "getQueryResult returned no results");

    asr = ars.getASRs().get(0);
    Assert.assertNotNull(asr, "Unparseable result from result.");

}
 
开发者ID:peculater,项目名称:azure-bing-search-java,代码行数:26,代码来源:AzureSearchWebTest.java


示例4: searchWordAndSave

import net.billylieurance.azuresearch.AzureSearchWebResult; //导入依赖的package包/类
@Override
protected void searchWordAndSave(String word){

    boolean breakFlag = false;
    AzureSearchWebQuery aq = new AzureSearchWebQuery();
    aq.setAppid(BabelConfig.getInstance().getConfigFromFile().bing());
    aq.setQuery(word + " AND \"Powered by phpBB\"" + " NOT lang:en");
    // The results are paged. You can get 50 results per page max.
    // This example gets 150 results
    aq.setPerPage(50);

    for (int i=1; !breakFlag ; i++) {
        aq.setPage(i);
        aq.doQuery();

        AzureSearchResultSet<AzureSearchWebResult> ars = aq.getQueryResult();
        numOfRequests.getAndIncrement();
        for (AzureSearchWebResult anr : ars) {
            BBJob job = new BBJob(anr.getUrl(),lang, logDb);
            try {
                if(job.isValid())
                    broker.put(job);
                else{
                    log.debug("Job not valid: " + job);
                }
            } catch (InterruptedException e) {
                log.error(e);
            }
        }
    }
}
 
开发者ID:gidim,项目名称:Babler,代码行数:32,代码来源:BBSearchProducer.java


示例5: searchWordAndSave

import net.billylieurance.azuresearch.AzureSearchWebResult; //导入依赖的package包/类
@Override
protected void searchWordAndSave(String word){
    boolean breakFlag = false;
    int counter = 0;
    AzureSearchWebQuery aq = new AzureSearchWebQuery();
    aq.setAppid(BabelConfig.getInstance().getConfigFromFile().bing());//julia's key
    //aq.setAppid("8LcemWAvkBRUS/uVBsI0vQFDT74FfrgyiV+PTkPIjMw");
    aq.setQuery("site:blogspot.com " + " \""+word+"\"" + " NOT lang:en"); //site:blogspot.com "word"
    aq.setPerPage(50);
    // The results are paged. You can get 50 results per page max.
    for (int i=1; !breakFlag ; i++) {
        aq.setPage(i);
        aq.doQuery();
        AzureSearchResultSet<AzureSearchWebResult> ars = aq.getQueryResult();
        if(counter++ == 100 ||ars.getAsrs().size() == 0)
            breakFlag = true;
        numOfRequests.getAndIncrement();
        for (AzureSearchWebResult anr : ars) {
            BSJob job = new BSJob(anr.getUrl(),lang, logDb);
            try {
                if(job.isValid())
                    broker.put(job);
                else{
                    log.debug("Job not valid: " + job);
                }
            } catch (InterruptedException e) {
                log.error(e);
            }
        }
    }
}
 
开发者ID:gidim,项目名称:Babler,代码行数:32,代码来源:BSSearchProducer.java


示例6: checkIsAWebResult

import net.billylieurance.azuresearch.AzureSearchWebResult; //导入依赖的package包/类
/**
 *
 */
@Test(dependsOnMethods = "buildQueryResult")
public void checkIsAWebResult() {
    Assert.assertTrue(asr instanceof AzureSearchWebResult);
}
 
开发者ID:peculater,项目名称:azure-bing-search-java,代码行数:8,代码来源:AzureSearchCompositeTest.java



注:本文中的net.billylieurance.azuresearch.AzureSearchWebResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TenantsServiceConnectionDescriptorProvider类代码示例发布时间:2022-05-16
下一篇:
Java ECReportSpec类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap