Examples of deleteByQuery()


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

            if (exampleId == null) {
                throw new IllegalArgumentException("exampleId and text should not be null simultaneously");
            }
            SolrServer solrServer = getActiveSolrServer();
            try {
                solrServer.deleteByQuery(exampleIdField + ":" + exampleId);
                solrServer.commit();
                return exampleId;
            } catch (Exception e) {
                String msg = String.format("Error deleting example with id '%s' on Solr Core '%s'",
                    exampleId, solrCoreId);
View Full Code Here

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

    @Override
    public void removeAllConcepts() throws ClassifierException {
        SolrServer solrServer = getActiveSolrServer();
        try {
            solrServer.deleteByQuery("*:*");
            solrServer.commit();
        } catch (Exception e) {
            String msg = String.format("Error deleting concepts from Solr Core '%s'", solrCoreId);
            throw new ClassifierException(msg, e);
        }
View Full Code Here

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

        if (conceptId == null || conceptId.isEmpty()) {
            throw new ClassifierException("conceptId must not be null or empty");
        }
        SolrServer solrServer = getActiveSolrServer();
        try {
            solrServer.deleteByQuery(conceptUriField + ":" + ClientUtils.escapeQueryChars(conceptId));
            solrServer.commit();
        } catch (Exception e) {
            String msg = String
                    .format("Error removing concept '%s' on Solr Core '%s'", conceptId, solrCoreId);
            throw new ClassifierException(msg, e);
View Full Code Here

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

            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                public Object run() throws IOException, SolrServerException {
                    if(config.isMultiYardIndexLayout()){
                        //make sure we only delete the Entity only if it is  managed by
                        //this Yard. Entities of other Yards MUST NOT be deleted!
                        server.deleteByQuery(String.format("%s:%s AND %s:%s",
                            fieldMapper.getDocumentDomainField(),
                            SolrUtil.escapeSolrSpecialChars(getId()),
                            fieldMapper.getDocumentIdField(),
                            SolrUtil.escapeSolrSpecialChars(id)));
                    } else {
View Full Code Here

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

                    if(config.isMultiYardIndexLayout()){
                        //make sure we only delete Entities managed by this Yard
                        //if someone parses an ID managed by an other yard we MUST NOT
                        //delete it!
                        for(String id : toRemove){
                            server.deleteByQuery(String.format("%s:%s AND %s:%s",
                                fieldMapper.getDocumentDomainField(),
                                SolrUtil.escapeSolrSpecialChars(getId()),
                                fieldMapper.getDocumentIdField(),
                                SolrUtil.escapeSolrSpecialChars(id)));
                        }
View Full Code Here

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

                    //ensures that the fildMapper is initialised and reads the
                    //namespace config before deleting all documents
                    FieldMapper fieldMapper = getFieldMapper();
                    if(config.isMultiYardIndexLayout()){
                        //only delete entities of this referenced site
                        server.deleteByQuery(String.format("%s:%s",
                            fieldMapper.getDocumentDomainField(),
                            SolrUtil.escapeSolrSpecialChars(getId())));
                    } else { //we can delete all
                        server.deleteByQuery("*:*");
                    }
View Full Code Here

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

                        //only delete entities of this referenced site
                        server.deleteByQuery(String.format("%s:%s",
                            fieldMapper.getDocumentDomainField(),
                            SolrUtil.escapeSolrSpecialChars(getId())));
                    } else { //we can delete all
                        server.deleteByQuery("*:*");
                    }
                    //ensure that the namespace config is stored again after deleting
                    //all documents
                    getFieldMapper().saveNamespaceConfig(false);
                    server.commit();
View Full Code Here

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

        } 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_COMMIT)) {
            serverToUse.commit();
        } else if (operation.equalsIgnoreCase(SolrConstants.OPERATION_ROLLBACK)) {
View Full Code Here

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

        repository.getDefaultTable().recordBuilder().id("testId").field(linkField, new Link(id)).update();
    }

    private void wipeSolr(String coreName) throws Exception{
        SolrServer server = lilyProxy.getSolrProxy().getSolrServer(coreName);
        server.deleteByQuery("*:*");
        server.commit();
        assertEquals(0, countDocsInRepo(coreName));
    }

    private long countDocsInRepo(String coreName) throws SolrServerException {
View Full Code Here

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

  }

  private void deleteAllDocuments() throws SolrServerException, IOException {
    collector.reset();
    SolrServer s = solrServer;
    s.deleteByQuery("*:*"); // delete everything!
    s.commit();
  }

  protected Command createMorphline(String file) throws IOException {
    return new PipeBuilder().build(parse(file), null, collector, createMorphlineContext());
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.