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

Java FacetComponent类代码示例

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

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



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

示例1: init

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
public void init(NamedList args) {
  maxOriginalResults = getInt(args, "maxOriginalResults");
  String tmp = (String) args.get("allComponentNames");
  if (tmp != null) {
    componentNames.addAll(Arrays.asList(tmp.split("\\s*,\\s*")));
  }
  componentNames.add(getComponentName());
  componentNames.add(FacetComponent.COMPONENT_NAME);
  componentNames.add(HighlightComponent.COMPONENT_NAME);
  componentNames.add(StatsComponent.COMPONENT_NAME);
  componentNames.add(TermsComponent.COMPONENT_NAME);
  componentNames.add(TermVectorComponent.COMPONENT_NAME);
  componentNames.add(SpellCheckComponent.COMPONENT_NAME);
  componentNames.add(MoreLikeThisComponent.COMPONENT_NAME);
  componentNames.add(GroupParams.GROUP);
  componentNames.add("queryRelaxer");
  componentNames.add("DymReSearcher");
  componentNames.add("autoComplete");
  commonMisspellingsFileLocation = (String) args.get("commonMisspellingsFile");
  commonMisspellingsMap = CommonMisspellings.loadCommonMisspellingsFile(commonMisspellingsFileLocation);
}
 
开发者ID:sematext,项目名称:solr-researcher,代码行数:24,代码来源:AbstractReSearcherComponent.java


示例2: loadSearchComponents

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
/**
 * Register the default search components
 */
private Map<String, SearchComponent> loadSearchComponents()
{
  Map<String, SearchComponent> components = new HashMap<>();
  initPlugins(components,SearchComponent.class);
  for (Map.Entry<String, SearchComponent> e : components.entrySet()) {
    SearchComponent c = e.getValue();
    if (c instanceof HighlightComponent) {
      HighlightComponent hl = (HighlightComponent) c;
      if(!HighlightComponent.COMPONENT_NAME.equals(e.getKey())){
        components.put(HighlightComponent.COMPONENT_NAME,hl);
      }
      break;
    }
  }
  addIfNotPresent(components,HighlightComponent.COMPONENT_NAME,HighlightComponent.class);
  addIfNotPresent(components,QueryComponent.COMPONENT_NAME,QueryComponent.class);
  addIfNotPresent(components,FacetComponent.COMPONENT_NAME,FacetComponent.class);
  addIfNotPresent(components,MoreLikeThisComponent.COMPONENT_NAME,MoreLikeThisComponent.class);
  addIfNotPresent(components,StatsComponent.COMPONENT_NAME,StatsComponent.class);
  addIfNotPresent(components,DebugComponent.COMPONENT_NAME,DebugComponent.class);
  addIfNotPresent(components,RealTimeGetComponent.COMPONENT_NAME,RealTimeGetComponent.class);
  addIfNotPresent(components,ExpandComponent.COMPONENT_NAME,ExpandComponent.class);

  return components;
}
 
开发者ID:europeana,项目名称:search,代码行数:29,代码来源:SolrCore.java


示例3: testComponentsName

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
@Test
public void testComponentsName() {
  assertU(adoc("id", "0", "name", "Zapp Brannigan"));
  assertU(adoc("id", "1", "name", "The Zapper"));
  assertU((commit()));
  
  assertQ("match all docs query",
      req("q","*:*")
      ,"//result[@numFound='2']",
      "/response/str[@name='component1'][.='foo']", 
      "/response/str[@name='component2'][.='bar']");
  
  assertQ("use debugQuery",
      req("q","*:*",
          "debugQuery", "true")
      ,"//result[@numFound='2']",
      "/response/str[@name='component1'][.='foo']", 
      "/response/str[@name='component2'][.='bar']",
      "/response/lst[@name='debug']/lst[@name='timing']/lst[@name='prepare']/lst[@name='component1']",
      "/response/lst[@name='debug']/lst[@name='timing']/lst[@name='prepare']/lst[@name='" + QueryComponent.COMPONENT_NAME + "']",
      "/response/lst[@name='debug']/lst[@name='timing']/lst[@name='prepare']/lst[@name='" + FacetComponent.COMPONENT_NAME + "']",
      "/response/lst[@name='debug']/lst[@name='timing']/lst[@name='prepare']/lst[@name='" + MoreLikeThisComponent.COMPONENT_NAME + "']",
      "/response/lst[@name='debug']/lst[@name='timing']/lst[@name='prepare']/lst[@name='" + StatsComponent.COMPONENT_NAME + "']",
      "/response/lst[@name='debug']/lst[@name='timing']/lst[@name='prepare']/lst[@name='" + DebugComponent.COMPONENT_NAME + "']",
      "/response/lst[@name='debug']/lst[@name='timing']/lst[@name='prepare']/lst[@name='component2']");
}
 
开发者ID:europeana,项目名称:search,代码行数:27,代码来源:TestComponentsName.java


示例4: loadSearchComponents

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
/**
 * Register the default search components
 */
private Map<String, SearchComponent> loadSearchComponents()
{
  Map<String, SearchComponent> components = new HashMap<String, SearchComponent>();
  initPlugins(components,SearchComponent.class);
  for (Map.Entry<String, SearchComponent> e : components.entrySet()) {
    SearchComponent c = e.getValue();
    if (c instanceof HighlightComponent) {
      HighlightComponent hl = (HighlightComponent) c;
      if(!HighlightComponent.COMPONENT_NAME.equals(e.getKey())){
        components.put(HighlightComponent.COMPONENT_NAME,hl);
      }
      break;
    }
  }
  addIfNotPresent(components,HighlightComponent.COMPONENT_NAME,HighlightComponent.class);
  addIfNotPresent(components,QueryComponent.COMPONENT_NAME,QueryComponent.class);
  addIfNotPresent(components,FacetComponent.COMPONENT_NAME,FacetComponent.class);
  addIfNotPresent(components,MoreLikeThisComponent.COMPONENT_NAME,MoreLikeThisComponent.class);
  addIfNotPresent(components,StatsComponent.COMPONENT_NAME,StatsComponent.class);
  addIfNotPresent(components,DebugComponent.COMPONENT_NAME,DebugComponent.class);
  addIfNotPresent(components,RealTimeGetComponent.COMPONENT_NAME,RealTimeGetComponent.class);
  return components;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:27,代码来源:SolrCore.java


示例5: loadSearchComponents

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
/**
 * Register the default search components
 */
private Map<String, SearchComponent> loadSearchComponents() {
	Map<String, SearchComponent> components = new HashMap<String, SearchComponent>();
	initPlugins(components, SearchComponent.class);
	for(Map.Entry<String, SearchComponent> e : components.entrySet()) {
		SearchComponent c = e.getValue();
		if(c instanceof HighlightComponent) {
			HighlightComponent hl = (HighlightComponent) c;
			if(!HighlightComponent.COMPONENT_NAME.equals(e.getKey())) {
				components.put(HighlightComponent.COMPONENT_NAME, hl);
			}
			break;
		}
	}
	addIfNotPresent(components, HighlightComponent.COMPONENT_NAME, HighlightComponent.class);
	addIfNotPresent(components, QueryComponent.COMPONENT_NAME, QueryComponent.class);
	addIfNotPresent(components, FacetComponent.COMPONENT_NAME, FacetComponent.class);
	addIfNotPresent(components, MoreLikeThisComponent.COMPONENT_NAME, MoreLikeThisComponent.class);
	addIfNotPresent(components, StatsComponent.COMPONENT_NAME, StatsComponent.class);
	addIfNotPresent(components, DebugComponent.COMPONENT_NAME, DebugComponent.class);
	addIfNotPresent(components, RealTimeGetComponent.COMPONENT_NAME, RealTimeGetComponent.class);
	return components;
}
 
开发者ID:netboynb,项目名称:search-core,代码行数:26,代码来源:SolrCore.java


示例6: addFacet

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
private void addFacet(SolrQueryRequest req, SolrQueryResponse rsp, SolrParams params, DocListAndSet rfDocs) {
    if( rfDocs.docSet == null ) {
        rsp.add( "facet_counts", null );
    }
    else {
        FacetComponent fct = new FacetComponent();
        rsp.add( "facet_counts", fct.getFacetCounts(new SimpleFacets(req, rfDocs.docSet, params )) );
    }
}
 
开发者ID:DiceTechJobs,项目名称:RelevancyFeedback,代码行数:10,代码来源:UnsupervisedFeedbackHandler.java


示例7: testFacet

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
@Test
public void testFacet() {
  assertQ(req(CommonParams.QT, "dismax_relaxer", CommonParams.Q, "bi marley ",
      QueryRelaxerComponent.COMPONENT_NAME, "true", FacetComponent.COMPONENT_NAME, "true", FacetParams.FACET_FIELD, "id")
            ,"//result[@name='response'][@numFound='0']"
            ,"//arr[@name='relaxer_suggestions']/lst[1]/str[@name='relaxedQuery'][.='marley']"
            ,"//arr[@name='relaxer_suggestions']/lst[1]/lst[@name='relaxer_facet_counts']/lst[@name='facet_fields']/lst[@name='id']"
          );
}
 
开发者ID:sematext,项目名称:solr-researcher,代码行数:10,代码来源:TestQueryRelaxerComponent.java


示例8: addFacet

import org.apache.solr.handler.component.FacetComponent; //导入依赖的package包/类
private void addFacet(SolrQueryRequest req, SolrQueryResponse rsp, SolrParams params, DocListAndSet mltDocs) {
    if( mltDocs.docSet == null ) {
        rsp.add( "facet_counts", null );
    }
    else {
        FacetComponent fct = new FacetComponent();
        rsp.add( "facet_counts", fct.getFacetCounts(new SimpleFacets(req, mltDocs.docSet, params )) );
    }
}
 
开发者ID:DiceTechJobs,项目名称:SolrPlugins,代码行数:10,代码来源:DiceMoreLikeThisHandler.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java MendixObjectReferenceSet类代码示例发布时间:2022-05-23
下一篇:
Java ConnectFuture类代码示例发布时间: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