当前位置: 首页>>代码示例>>Java>>正文


Java CoreAdminRequest.process方法代码示例

本文整理汇总了Java中org.apache.solr.client.solrj.request.CoreAdminRequest.process方法的典型用法代码示例。如果您正苦于以下问题:Java CoreAdminRequest.process方法的具体用法?Java CoreAdminRequest.process怎么用?Java CoreAdminRequest.process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.solr.client.solrj.request.CoreAdminRequest的用法示例。


在下文中一共展示了CoreAdminRequest.process方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRemoteCores

import org.apache.solr.client.solrj.request.CoreAdminRequest; //导入方法依赖的package包/类
/**
 * Get list of cores from the remote Solr server.
 * 
 * @return Map of cores attributes keyed by core name.
 * @throws SophieException
 *             If the list of cores cannot be fetched.
 */
@SuppressWarnings("unchecked")
public static Map<String, NamedList<Object>> getRemoteCores() throws SophieException {
    CoreAdminRequest request = new CoreAdminRequest();
    request.setAction(CoreAdminAction.STATUS);
    try {
        CoreAdminResponse response = request.process(Sophie.client);
        return response.getCoreStatus().asMap(-1);
    } catch (SolrServerException | IOException | SolrException e) {
        throw new SophieException("Unable to fetch list of Solr cores", e);
    }
}
 
开发者ID:fengtan,项目名称:sophie,代码行数:19,代码来源:SolrUtils.java

示例2: testReloadCore

import org.apache.solr.client.solrj.request.CoreAdminRequest; //导入方法依赖的package包/类
@Test
public void testReloadCore() throws Exception {
  SolrInputDocument doc = new SolrInputDocument();
  doc.addField("uri", "/doc/1");
  doc.addField(TITLE_FIELD, TITLE);
  doc.addField(TEXT_FIELD, TEXT);
  solr.add(doc);
  solr.commit(false, true, true);

  CoreAdminRequest reload = new CoreAdminRequest();
  reload.setAction(CoreAdminAction.RELOAD);
  reload.setCoreName("collection1");
  reload.process(solr);
}
 
开发者ID:safarijv,项目名称:ifpress-solr-plugin,代码行数:15,代码来源:MultiSuggesterTest.java

示例3: getCoreList

import org.apache.solr.client.solrj.request.CoreAdminRequest; //导入方法依赖的package包/类
public List<String> getCoreList() throws IOException, SolrServerException {
    SolrClient solrClient = getSolrclient(null);
    CoreAdminRequest coreAdminRequest = new CoreAdminRequest();
    coreAdminRequest.setAction(CoreAdminParams.CoreAdminAction.STATUS);
    CoreAdminResponse cores = coreAdminRequest.process(solrClient);

    List<String> coreList = new ArrayList<String>();
    for (int i = 0; i < cores.getCoreStatus().size(); i++) {
        coreList.add(cores.getCoreStatus().getName(i));
    }
    return coreList;
}
 
开发者ID:Stratio,项目名称:Decision,代码行数:13,代码来源:SolrOperationsService.java

示例4: checkIndexExists

import org.apache.solr.client.solrj.request.CoreAdminRequest; //导入方法依赖的package包/类
private boolean checkIndexExists(IndexConfiguration indexConfiguration) {
    CoreAdminResponse cores = null;
    
    try {
        CoreAdminRequest request = new CoreAdminRequest();
        request.setAction(CoreAdminAction.STATUS);
        cores = request.process(solrServer);
    } catch (SolrServerException | IOException e) {
        throw new SolrConfigurationException("Unable to check solr indexes status", e);
    }
    
    NamedList<Object> indexStatus = cores.getCoreStatus(indexConfiguration.getName());
    
    return indexStatus != null;
}
 
开发者ID:CeON,项目名称:saos,代码行数:16,代码来源:SolrIndexReloader.java


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