Package org.apache.solr.client.solrj

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


        managedSolrServer).getServer(ldProgramName);
    id = ContentItemIDOrganizer.attachBaseURI(id);
    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) {
      log.error("IOException", e);
View Full Code Here


      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) {
      log.error("IOException", e);
View Full Code Here

                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);
                throw new TrainingSetException(msg, e);
View Full Code Here

        }
        doc.addField(modificationDateField, UTCTimeStamper.nowUtcDate());
        SolrServer server = getActiveSolrServer();
        try {
            server.add(doc);
            server.commit();
        } catch (Exception e) {
            String msg = String.format("Could not register example '%s' with topics: ['%s']", exampleId,
                StringUtils.join(topics, "', '"));
            throw new TrainingSetException(msg, e);
        }
View Full Code Here

        try {
            UpdateRequest request = new UpdateRequest();
            request.add(metadataEntry);
            request.add(modelEntry);
            solrServer.request(request);
            solrServer.commit();
        } catch (Exception e) {
            String msg = String.format("Error adding topic with id '%s' on Solr Core '%s'", conceptUri,
                solrCoreId);
            throw new ClassifierException(msg, e);
        }
View Full Code Here

    @Override
    public void removeConcept(String conceptId) throws ClassifierException {
        SolrServer solrServer = getActiveSolrServer();
        try {
            solrServer.deleteByQuery(conceptUriField + ":" + ClientUtils.escapeQueryChars(conceptId));
            solrServer.commit();
        } catch (Exception e) {
            String msg = String.format("Error removing topic with id '%s' on Solr Core '%s'", conceptId,
                solrCoreId);
            throw new ClassifierException(msg, e);
        }
View Full Code Here

                        count++;
                        batchDocuments.add(result);
                    }
                }
                processedCount += processor.process(batchDocuments);
                solrServer.commit();
                if (count < batchSize) {
                    done = true;
                }
            }
            solrServer.optimize();
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.