Package org.apache.solr.client.solrj.request

Examples of org.apache.solr.client.solrj.request.DirectXmlRequest


                if (!bodyAsString.startsWith("<add")) {
                    bodyAsString = "<add>" + bodyAsString + "</add>";
                }

                DirectXmlRequest xmlRequest = new DirectXmlRequest(getRequestHandler(), bodyAsString);

                solrServer.request(xmlRequest);               
            } else {
                throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "unable to find data in Exchange to update Solr");
            }
View Full Code Here


      xml.append( "<id>" );
      XML.escapeCharData( (String)d.getField( "id" ).getFirstValue(), xml );
      xml.append( "</id>" );
    }
    xml.append( "</delete>" );
    DirectXmlRequest up = new DirectXmlRequest( "/update", xml.toString() );
    server.request( up );
    server.commit();
    assertNumFound( "*:*", 0 ); // make sure it got out
  }
View Full Code Here

                if (!bodyAsString.startsWith("<add")) {
                    bodyAsString = "<add>" + bodyAsString + "</add>";
                }

                DirectXmlRequest xmlRequest = new DirectXmlRequest(getRequestHandler(), bodyAsString);

                if (isStreaming) {
                    streamingSolrServer.request(xmlRequest);
                } else {
                    solrServer.request(xmlRequest);
View Full Code Here

              logger.info("[{}]: sending: {}...", core, xmlFile);
              // Ensure it's in UTF-8 encoding
              Reader reader = new InputStreamReader(
                  new FileInputStream(xmlFile), "UTF-8");
              String body = IOUtils.toString(reader);
              SolrRequest request = new DirectXmlRequest("/update", body);
              /** Post the document to the Index */
              request.process(server);
              IOUtils.closeQuietly(reader);
            }
            // Commit the changes
            server.commit();
          } catch (Exception ex) {
View Full Code Here

              logger.info("[{}]: sending: {}...", core, xmlFile);
              // Ensure it's in UTF-8 encoding
              Reader reader = new InputStreamReader(
                  new FileInputStream(xmlFile), "UTF-8");
              String body = IOUtils.toString(reader);
              SolrRequest request = new DirectXmlRequest("/update", body);
              /** Post the document to the Index */
              request.process(server);
              IOUtils.closeQuietly(reader);
            }
            // Commit the changes
            server.commit();
          } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.request.DirectXmlRequest

Copyright © 2018 www.massapicom. 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.