Examples of UpdateRequestProcessorChain


Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

  public void doLegacyUpdate(InputStream input, String inputContentType, Writer output) {
    SolrCore core = SolrCore.getSolrCore();
    SolrQueryRequest req = new LocalSolrQueryRequest(core, new HashMap<String,String[]>());
    try {
      // Old style requests do not choose a custom handler
      UpdateRequestProcessorChain processorFactory = core.getUpdateProcessingChain(null);
      SolrQueryResponse rsp = new SolrQueryResponse(); // ignored
      final String charset = ContentStreamBase.getCharsetFromContentType(inputContentType);
      final XMLStreamReader parser = (charset == null) ?
        inputFactory.createXMLStreamReader(input) : inputFactory.createXMLStreamReader(input, charset);
      UpdateRequestProcessor processor = processorFactory.createProcessor(req, rsp);
      XMLLoader loader = (XMLLoader) newLoader(req, processor);
      loader.processUpdate(processor, parser);
      processor.finish();
      output.write("<result status=\"0\"></result>");
    }
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

  void createIndex2(int nDocs, String... fields) throws IOException {
    Set<String> fieldSet = new HashSet<String>(Arrays.asList(fields));

    SolrQueryRequest req = lrf.makeRequest();
    SolrQueryResponse rsp = new SolrQueryResponse();
    UpdateRequestProcessorChain processorChain = req.getCore().getUpdateProcessingChain(null);
    UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);

    boolean foomany_s = fieldSet.contains("foomany_s");
    boolean foo1_s = fieldSet.contains("foo1_s");
    boolean foo2_s = fieldSet.contains("foo2_s");
    boolean foo4_s = fieldSet.contains("foo4_s");
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

  public void testConfiguration() throws Exception
  {
    SolrCore core = h.getCore();

    // make sure it loaded the factories
    UpdateRequestProcessorChain chained = core.getUpdateProcessingChain( "standard" );
   
    // Make sure it got 3 items and configured the Log chain ok
    assertEquals( 3, chained.getFactories().length );
    LogUpdateProcessorFactory log = (LogUpdateProcessorFactory)chained.getFactories()[0];
    assertEquals( 100, log.maxNumToLog );
   
   
    UpdateRequestProcessorChain custom = core.getUpdateProcessingChain( null );
    CustomUpdateRequestProcessorFactory link = (CustomUpdateRequestProcessorFactory) custom.getFactories()[0];
   
    assertEquals( custom, core.getUpdateProcessingChain( "" ) );
    assertEquals( custom, core.getUpdateProcessingChain( "custom" ) );
   
    // Make sure the NamedListArgs got through ok
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

  void createIndex2(int nDocs, String... fields) throws IOException {
    Set<String> fieldSet = new HashSet<String>(Arrays.asList(fields));

    SolrQueryRequest req = lrf.makeRequest();
    SolrQueryResponse rsp = new SolrQueryResponse();
    UpdateRequestProcessorChain processorChain = req.getCore().getUpdateProcessingChain(null);
    UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);

    boolean foomany_s = fieldSet.contains("foomany_s");
    boolean foo1_s = fieldSet.contains("foo1_s");
    boolean foo2_s = fieldSet.contains("foo2_s");
    boolean foo4_s = fieldSet.contains("foo4_s");
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

 
  @Override
  public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
  {   
    SolrParams params = req.getParams();
    UpdateRequestProcessorChain processingChain =
      req.getCore().getUpdateProcessingChain( params.get( UpdateParams.UPDATE_PROCESSOR ) );
   
    UpdateRequestProcessor processor = processingChain.createProcessor(req, rsp);
    Iterable<ContentStream> streams = req.getContentStreams();
    if( streams == null ) {
      if( !RequestHandlerUtils.handleCommit(processor, params, false) ) {
        throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "missing content stream" );
      }
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

  public void doLegacyUpdate(Reader input, Writer output) {
    try {
      SolrCore core = SolrCore.getSolrCore();

      // Old style requests do not choose a custom handler
      UpdateRequestProcessorChain processorFactory = core.getUpdateProcessingChain( null );
     
      SolrParams params = new MapSolrParams( new HashMap<String, String>() );
      SolrQueryRequestBase req = new SolrQueryRequestBase( core, params ) {};
      SolrQueryResponse rsp = new SolrQueryResponse(); // ignored
      XMLStreamReader parser = inputFactory.createXMLStreamReader(input);
      UpdateRequestProcessor processor = processorFactory.createProcessor(req, rsp);
      this.processUpdate( processor, parser );
      processor.finish();
      output.write("<result status=\"0\"></result>");
    }
    catch (Exception ex) {
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

public class CSVRequestHandler extends RequestHandlerBase {

  public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
    SolrParams params = req.getParams();
    UpdateRequestProcessorChain processorChain =
            req.getCore().getUpdateProcessingChain( params.get( UpdateParams.UPDATE_PROCESSOR ) );

    UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);

    try {
      CSVLoader loader = new SingleThreadedCSVLoader(req, processor);

View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

      message = DataImporter.MSG.CMD_RUNNING;
    } else if (command != null) {
      if (DataImporter.FULL_IMPORT_CMD.equals(command)
              || DataImporter.DELTA_IMPORT_CMD.equals(command)) {

        UpdateRequestProcessorChain processorChain =
                req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_PROCESSOR));
        UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);
        SolrResourceLoader loader = req.getCore().getResourceLoader();
        SolrWriter sw = getSolrWriter(processor, loader, req
                .getSchema());

        if (requestParams.debug) {
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

    } else if (command != null) {
      if (DataImporter.FULL_IMPORT_CMD.equals(command)
              || DataImporter.DELTA_IMPORT_CMD.equals(command) ||
              IMPORT_CMD.equals(command)) {

        UpdateRequestProcessorChain processorChain =
                req.getCore().getUpdateProcessingChain(params.get(UpdateParams.UPDATE_PROCESSOR));
        UpdateRequestProcessor processor = processorChain.createProcessor(req, rsp);
        SolrResourceLoader loader = req.getCore().getResourceLoader();
        SolrWriter sw = getSolrWriter(processor, loader, requestParams);

        if (requestParams.debug) {
          if (debugEnabled) {
View Full Code Here

Examples of org.apache.solr.update.processor.UpdateRequestProcessorChain

        Directory[] dirs = new Directory[dirNames.length];
        for (int i = 0; i < dirNames.length; i++) {
          dirs[i] = dirFactory.open(dirNames[i]);
        }

        UpdateRequestProcessorChain processorChain =
                core.getUpdateProcessingChain(params.get(UpdateParams.UPDATE_PROCESSOR));
        SolrQueryRequest wrappedReq = new LocalSolrQueryRequest(core, req.getParams());
        UpdateRequestProcessor processor =
                processorChain.createProcessor(wrappedReq, rsp);
        processor.processMergeIndexes(new MergeIndexesCommand(dirs));
      } finally {
        core.close();
      }
    }
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.