本文整理汇总了Java中org.apache.pig.piggybank.evaluation.util.SearchQuery类的典型用法代码示例。如果您正苦于以下问题:Java SearchQuery类的具体用法?Java SearchQuery怎么用?Java SearchQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SearchQuery类属于org.apache.pig.piggybank.evaluation.util包,在下文中一共展示了SearchQuery类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSearchQuery
import org.apache.pig.piggybank.evaluation.util.SearchQuery; //导入依赖的package包/类
@Test
public void testSearchQuery() throws Exception {
String[] searchUrls = {
"http://www.google.co.in/advanced_search?q=google+Advanced+Query&hl=en",
"http://www.google.co.in/search?hl=en&as_q=google+simple+Query&as_epq=&as_oq=&as_eq=&num=10&lr=&as_filetype=&ft=i&as_sitesearch=&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=images",
"http://search.live.com/results.aspx?q=live+Query&go=&form=QBRE",
"http://search.aol.com/aol/search?s_it=searchbox.webhome&q=aol+query",
"http://search.yahoo.com/search;_ylt=A0geu8zce8NJQxYBmgal87UF?p=Yahoo+query&fr=sfp&fr2=&iscqry=" };
String[] queries = { "google advanced query", "google simple query",
"live query", "aol query", "yahoo query" };
SearchQuery sq = new SearchQuery();
Tuple tuple = DefaultTupleFactory.getInstance().newTuple(1);
for (int i = 0; i < searchUrls.length; i++) {
tuple.set(0, searchUrls[i]);
super.assertEquals(sq.exec(tuple), queries[i]);
}
}