org.apache.solr.handler.component.QueryComponent Java Examples
The following examples show how to use
org.apache.solr.handler.component.QueryComponent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestComponentsName.java From lucene-solr with Apache License 2.0 | 6 votes |
@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']"); }
Example #2
Source File: SolrCoreTest.java From lucene-solr with Apache License 2.0 | 6 votes |
@Test public void testInfoRegistry() throws Exception { //TEst that SolrInfoMBeans are registered, including SearchComponents SolrCore core = h.getCore(); Map<String, SolrInfoBean> infoRegistry = core.getInfoRegistry(); assertTrue("infoRegistry Size: " + infoRegistry.size() + " is not greater than: " + 0, infoRegistry.size() > 0); //try out some that we know are in the config SolrInfoBean bean = infoRegistry.get(SpellCheckComponent.COMPONENT_NAME); assertNotNull("bean not registered", bean); //try a default one bean = infoRegistry.get(QueryComponent.COMPONENT_NAME); assertNotNull("bean not registered", bean); //try a Req Handler, which are stored by name, not clas bean = infoRegistry.get("/select"); assertNotNull("bean not registered", bean); }