本文整理汇总了Java中net.billylieurance.azuresearch.AzureSearchResultSet类的典型用法代码示例。如果您正苦于以下问题:Java AzureSearchResultSet类的具体用法?Java AzureSearchResultSet怎么用?Java AzureSearchResultSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AzureSearchResultSet类属于net.billylieurance.azuresearch包,在下文中一共展示了AzureSearchResultSet类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromNewstitle2Newslist
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
public static List<String[]> fromNewstitle2Newslist(String newstitle) {
List<String[]> ret = new ArrayList<String[]>();
AzureSearchNewsQuery aq = new AzureSearchNewsQuery();
aq.setAppid("POQ8S/XONvSFxnUFrKANXTadRVzDAMN2E2cnCXmPOSM=");// 50,000
// transactions
// aq.setAppid("D4Makeg91kNY0ZuZ4SJBfNKQ69m/ay/VVwa+9NLTAIw=");//free
// 5000 transactions
aq.setQuery(newstitle);
aq.doQuery();
AzureSearchResultSet<AzureSearchNewsResult> ars = aq.getQueryResult();
for (AzureSearchNewsResult nsr : ars) {
ret.add(new String[] { nsr.getUrl(), nsr.getTitle(),
nsr.getDescription() });
}
return ret;
}
示例2: fromNewstitle2Newslist2
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
public static List<String[]> fromNewstitle2Newslist2(String newstitle) {
List<String[]> ret = new ArrayList<String[]>();
AzureSearchNewsQuery aq = new AzureSearchNewsQuery();
aq.setAppid("POQ8S/XONvSFxnUFrKANXTadRVzDAMN2E2cnCXmPOSM=");// 50,000
// transactions
// aq.setAppid("D4Makeg91kNY0ZuZ4SJBfNKQ69m/ay/VVwa+9NLTAIw=");//free
// 5000 transactions
aq.setQuery(newstitle);
aq.doQuery();
AzureSearchResultSet<AzureSearchNewsResult> ars = aq.getQueryResult();
for (AzureSearchNewsResult nsr : ars) {
ret.add(new String[] { nsr.getUrl(), nsr.getTitle(),
nsr.getDescription(), nsr.getDate() });
}
return ret;
}
示例3: fromQuery2Weblist
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的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;
}
示例4: buildQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
/**
*
*/
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildQueryResult() {
AzureSearchRelatedSearchQuery aq = new AzureSearchRelatedSearchQuery();
aq.setAppid(AzureAppid.AZURE_APPID);
aq.setDebug(true);
aq.setQuery("Oklahoma Sooners");
logURL(aq);
aq.doQuery();
Document ad = aq.getRawResult();
Assert.assertNotNull(ad);
AzureSearchResultSet<AzureSearchRelatedSearchResult> 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.");
}
示例5: buildQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的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.");
}
示例6: buildQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
/**
*
*/
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildQueryResult() {
AzureSearchVideoQuery aq = new AzureSearchVideoQuery();
aq.setAppid(AzureAppid.AZURE_APPID);
aq.setDebug(true);
aq.setQuery("Oklahoma Sooners");
logURL(aq);
aq.doQuery();
Document ad = aq.getRawResult();
Assert.assertNotNull(ad);
AzureSearchResultSet<AzureSearchVideoResult> 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.");
}
示例7: buildQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
/**
*
*/
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildQueryResult() {
AzureSearchSpellingSuggestionQuery aq = new AzureSearchSpellingSuggestionQuery();
aq.setAppid(AzureAppid.AZURE_APPID);
aq.setDebug(true);
aq.setQuery("Okahoma Sooners");
logURL(aq);
aq.doQuery();
Document ad = aq.getRawResult();
Assert.assertNotNull(ad);
AzureSearchResultSet<AzureSearchSpellingSuggestionResult> 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.");
}
示例8: buildNullQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
/**
*
*/
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildNullQueryResult() {
AzureSearchSpellingSuggestionQuery aq = new AzureSearchSpellingSuggestionQuery();
aq.setAppid(AzureAppid.AZURE_APPID);
aq.setQuery("Okahoma Sooners");
aq.doQuery();
Document ad = aq.getRawResult();
Assert.assertNotNull(ad);
AzureSearchResultSet<AzureSearchSpellingSuggestionResult> ars = aq.getQueryResult();
Assert.assertNotNull(ars, "getQueryResult returned null");
Assert.assertNotNull(ars.getASRs(), "getQueryResult.getASRs returned null");
}
示例9: buildQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
/**
*
*/
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildQueryResult() {
AzureSearchNewsQuery aq = new AzureSearchNewsQuery();
aq.setAppid(AzureAppid.AZURE_APPID);
aq.setDebug(true);
aq.setQuery("Oklahoma Sooners");
aq.setCategory("rt_Sports");
aq.setLocationOverride("US.OK");
aq.setSortBy("Date");
logURL(aq);
aq.doQuery();
Document ad = aq.getRawResult();
Assert.assertNotNull(ad);
AzureSearchResultSet<AzureSearchNewsResult> 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.");
}
示例10: buildQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的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.");
}
示例11: buildQueryResult
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的package包/类
/**
*
*/
@Test(dependsOnMethods = {"TestConstructor", "TestAppid"})
public void buildQueryResult() {
AzureSearchImageQuery aq = new AzureSearchImageQuery();
aq.setAppid(AzureAppid.AZURE_APPID);
aq.setDebug(true);
aq.setQuery("Oklahoma Sooners");
logURL(aq);
aq.doQuery();
Document ad = aq.getRawResult();
Assert.assertNotNull(ad);
AzureSearchResultSet<AzureSearchImageResult> 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.");
}
示例12: searchWordAndSave
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的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);
}
}
}
}
示例13: searchWordAndSave
import net.billylieurance.azuresearch.AzureSearchResultSet; //导入依赖的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);
}
}
}
}