本文整理汇总了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;未经允许,请勿转载。 |
请发表评论