Package org.apache.solr.client.solrj

Examples of org.apache.solr.client.solrj.SolrServer.deleteById()


        if (operation.equalsIgnoreCase(SolrConstants.OPERATION_INSERT)) {
            insert(exchange, serverToUse);
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_INSERT_STREAMING)) {
            insert(exchange, serverToUse);
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_DELETE_BY_ID)) {
            serverToUse.deleteById(exchange.getIn().getBody(String.class));
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_DELETE_BY_QUERY)) {
            serverToUse.deleteByQuery(exchange.getIn().getBody(String.class));
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ADD_BEAN)) {
            serverToUse.addBean(exchange.getIn().getBody());
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ADD_BEANS)) {
View Full Code Here


        }
       
        boolean isSuccess = false;
        try {
            SolrServer solrClient = this.getSolrClient();
            solrClient.deleteById(ids, COMMIT_WITHIN_MS);
            isSuccess = true;
        } catch (SolrServerException e) {
            logger.error("Delete indexs by ids fail!", e);
        } catch (IOException e) {
            logger.error("Delete indexs by ids fail!", e);
View Full Code Here

        }
       
        boolean isSuccess = false;
        try {
            SolrServer solrClient = this.getSolrClient();
            solrClient.deleteById(id, COMMIT_WITHIN_MS);
            isSuccess = true;
        } catch (SolrServerException e) {
            logger.error("Delete index by id fail!", e);
        } catch (IOException e) {
            logger.error("Delete indexs by id fail!", e);
View Full Code Here

        .withRecordColumns("fam.value").create();

    assertTotalResults(table, "rowid:0", 1l);
    assertTotalResults(table, "rowid:1", 1l);

    server.deleteById("1");

    assertTotalResults(table, "rowid:0", 1l);
    assertTotalResults(table, "rowid:1", 0l);

    removeTable(table);
View Full Code Here

        .withRecordColumns("fam.value").create();

    assertTotalResults(table, "rowid:1", 1l);
    assertTotalResults(table, "rowid:2", 1l);
    List<String> ids = Lists.newArrayList("1", "2", "3", "4", "5");
    server.deleteById(ids);

    for (String id : ids) {
      assertTotalResults(table, "rowid:" + id, 0l);
    }
View Full Code Here

        if (id == null || id.isEmpty()) return;
        SolrServer solrServer = SolrCoreManager.getInstance(bundleContext, managedSolrServer).getServer(
            ldProgramName);
        removeEnhancements(id);
        try {
            solrServer.deleteById(id);
            solrServer.commit();
        } catch (SolrServerException e) {
            log.error("Solr Server Exception", e);
            throw new StoreException(e.getMessage(), e);
        } catch (IOException e) {
View Full Code Here

            String id = idList.get(i);
            idList.remove(i);
            idList.add(i, id);
        }
        try {
            solrServer.deleteById(idList);
            solrServer.commit();
        } catch (SolrServerException e) {
            log.error("Solr Server Exception", e);
            throw new StoreException(e.getMessage(), e);
        } catch (IOException e) {
View Full Code Here

        if (id == null || id.isEmpty()) return;
        SolrServer solrServer = SolrCoreManager.getInstance(bundleContext, managedSolrServer).getServer(
            ldProgramName);
        removeEnhancements(id);
        try {
            solrServer.deleteById(id);
            solrServer.commit();
        } catch (SolrServerException e) {
            log.error("Solr Server Exception", e);
            throw new StoreException(e.getMessage(), e);
        } catch (IOException e) {
View Full Code Here

            String id = idList.get(i);
            idList.remove(i);
            idList.add(i, id);
        }
        try {
            solrServer.deleteById(idList);
            solrServer.commit();
        } catch (SolrServerException e) {
            log.error("Solr Server Exception", e);
            throw new StoreException(e.getMessage(), e);
        } catch (IOException e) {
View Full Code Here

                            fieldMapper.getDocumentDomainField(),
                            SolrUtil.escapeSolrSpecialChars(getId()),
                            fieldMapper.getDocumentIdField(),
                            SolrUtil.escapeSolrSpecialChars(id)));
                    } else {
                        server.deleteById(id);
                    }
                    server.commit();
                    return null;
                }
            });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.