• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SearchHandler类代码示例

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

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



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

示例1: SuggestionService

import org.apache.solr.handler.component.SearchHandler; //导入依赖的package包/类
public SuggestionService(SolrCore solrCore, NamedList args) {

        NamedList l = new NamedList();

        //set spellcheck component if there is one
        if(((ArrayList)args.get("first-components")).contains("spellcheck")) {
            List component = new ArrayList<String>();
            component.add("spellcheck");
            l.add("first-components",component);
            spellcheck_enabled = true;
        }

        if(args.get("defaults") != null && ((NamedList)args.get("defaults")).get(SuggestionRequestParams.SUGGESTION_INTERNAL_LIMIT) != null) {
            internalFacetLimit = (String)((NamedList)args.get("defaults")).get(SuggestionRequestParams.SUGGESTION_INTERNAL_LIMIT);
        }

        this.solrCore = solrCore;
        this.searchHandler = new SearchHandler();
        this.searchHandler.init(l);
        this.searchHandler.inform(solrCore);
    }
 
开发者ID:RBMHTechnology,项目名称:vind,代码行数:22,代码来源:SuggestionService.java


示例2: setUp

import org.apache.solr.handler.component.SearchHandler; //导入依赖的package包/类
@Before
public void setUp() {
	rh1 = mock(SearchHandler.class);
	rh2 = mock(SearchHandler.class);
	rh3 = mock(SearchHandler.class);
	
	cut = new InvisibleQueriesRequestHandler();
	
	qrequest = mock(SolrQueryRequest.class);
	qresponse = mock(SolrQueryResponse.class);
	
	args = new SimpleOrderedMap<>();
	args.add(
			InvisibleQueriesRequestHandler.CHAIN_KEY, 
			SAMPLE_VALID_CHAIN.stream().collect(joining(",")));
	
	params = new ModifiableSolrParams().add(SAMPLE_KEY, SAMPLE_VALUE);
}
 
开发者ID:spaziocodice,项目名称:invisible-queries-request-handler,代码行数:19,代码来源:FacadeRequestHandlerTestCase.java


示例3: handleRequestBody

import org.apache.solr.handler.component.SearchHandler; //导入依赖的package包/类
@Override
public void handleRequestBody(
		final SolrQueryRequest request, 
		final SolrQueryResponse response) throws Exception {
	final SolrParams params = request.getParams();

	response.setAllValues(
		chain.stream()
			.map(refName -> { return requestHandler(request, refName); })
			.filter(SearchHandler.class::isInstance) 
			.map(handler -> { return executeQuery(request, response, params, handler); })
			.filter(qresponse -> howManyFound(qresponse) > 0)
			.findFirst()
			.orElse(emptyResponse(request, response)));
}
 
开发者ID:spaziocodice,项目名称:invisible-queries-request-handler,代码行数:16,代码来源:InvisibleQueriesRequestHandler.java


示例4: setUp

import org.apache.solr.handler.component.SearchHandler; //导入依赖的package包/类
@Before
public void setUp() {
	rh1 = mock(SearchHandler.class);
	rh2 = mock(SearchHandler.class);
	rh3 = mock(SearchHandler.class);

	qrequest = mock(SolrQueryRequest.class);
	qresponse = mock(SolrQueryResponse.class);
	
	args = new SimpleOrderedMap<>();
	args.add(
			InvisibleQueriesRequestHandler.CHAIN_KEY, 
			SAMPLE_VALID_CHAIN.stream().collect(joining(",")));
	
	params = new ModifiableSolrParams().add(SAMPLE_KEY, SAMPLE_VALUE);
	
	core = mock(SolrCore.class);
	when(qrequest.getCore()).thenReturn(core);
	
	when(core.getRequestHandler(REQUEST_HANDLER_1_NAME)).thenReturn(rh1);
	when(core.getRequestHandler(REQUEST_HANDLER_2_NAME)).thenReturn(rh2);
	when(core.getRequestHandler(REQUEST_HANDLER_3_NAME)).thenReturn(rh3);
	
	cut = new InvisibleQueriesRequestHandler();
	
	positiveResult = mock(ResultContext.class);
	docList = mock(DocList.class);
	when(docList.size()).thenReturn(1);
	when(positiveResult.getDocList()).thenReturn(docList);
}
 
开发者ID:spaziocodice,项目名称:invisible-queries-request-handler,代码行数:31,代码来源:InvocationChainTestCase.java


示例5: testCallMBeanInfo

import org.apache.solr.handler.component.SearchHandler; //导入依赖的package包/类
/**
 * Gets a list of everything we can find in the classpath and makes sure it has
 * a name, description, etc...
 */
public void testCallMBeanInfo() throws Exception {
  List<Class> classes = new ArrayList<>();
  classes.addAll(getClassesForPackage(StandardRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchComponent.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LukeRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(DefaultSolrHighlighter.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LRUCache.class.getPackage().getName()));
 // System.out.println(classes);
  
  int checked = 0;
  for( Class clazz : classes ) {
    if( SolrInfoMBean.class.isAssignableFrom( clazz ) ) {
      try {
        SolrInfoMBean info = (SolrInfoMBean)clazz.newInstance();
        
        //System.out.println( info.getClass() );
        assertNotNull( info.getName() );
        assertNotNull( info.getDescription() );
        assertNotNull( info.getCategory() );
        
        if( info instanceof LRUCache ) {
          continue;
        }
        
        assertNotNull( info.toString() );
        // increase code coverage...
        assertNotNull( info.getDocs() + "" );
        assertNotNull( info.getStatistics()+"" );
        checked++;
      }
      catch( InstantiationException ex ) {
        // expected...
        //System.out.println( "unable to initalize: "+clazz );
      }
    }
  }
  assertTrue( "there are at least 10 SolrInfoMBean that should be found in the classpath, found " + checked, checked > 10 );
}
 
开发者ID:europeana,项目名称:search,代码行数:44,代码来源:SolrInfoMBeanTest.java


示例6: testCallMBeanInfo

import org.apache.solr.handler.component.SearchHandler; //导入依赖的package包/类
/**
 * Gets a list of everything we can find in the classpath and makes sure it has
 * a name, description, etc...
 */
public void testCallMBeanInfo() throws Exception {
  List<Class> classes = new ArrayList<Class>();
  classes.addAll(getClassesForPackage(StandardRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(SearchComponent.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LukeRequestHandler.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(DefaultSolrHighlighter.class.getPackage().getName()));
  classes.addAll(getClassesForPackage(LRUCache.class.getPackage().getName()));
 // System.out.println(classes);
  
  int checked = 0;
  for( Class clazz : classes ) {
    if( SolrInfoMBean.class.isAssignableFrom( clazz ) ) {
      try {
        SolrInfoMBean info = (SolrInfoMBean)clazz.newInstance();
        
        //System.out.println( info.getClass() );
        assertNotNull( info.getName() );
        assertNotNull( info.getDescription() );
        assertNotNull( info.getSource() );
        assertNotNull( info.getCategory() );
        
        // Make sure the URL has the classname in it
        //assertTrue(info.getSource(), info.getSource().indexOf(info.getClass().getSimpleName()+".java")>0 );

        if( info instanceof LRUCache ) {
          continue;
        }
        
        assertNotNull( info.toString() );
        // increase code coverage...
        assertNotNull( info.getDocs() + "" );
        assertNotNull( info.getStatistics()+"" );
        checked++;
      }
      catch( InstantiationException ex ) {
        // expected...
        //System.out.println( "unable to initalize: "+clazz );
      }
    }
  }
  assertTrue( "there are at least 10 SolrInfoMBean that should be found in the classpath, found " + checked, checked > 10 );
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:48,代码来源:SolrInfoMBeanTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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