Package org.apache.solr.update

Examples of org.apache.solr.update.DeleteUpdateCommand


    return addCmd;
  }

  private void delete(List<String> l, UpdateRequestProcessor processor, boolean isId) throws IOException {
    for (String s : l) {
      DeleteUpdateCommand delcmd = new DeleteUpdateCommand();
      if (isId) {
        delcmd.id = s;
      } else {
        delcmd.query = s;
      }
View Full Code Here


  }

  DeleteUpdateCommand parseDelete() throws IOException {
    assertNextEvent( JSONParser.OBJECT_START );

    DeleteUpdateCommand cmd = new DeleteUpdateCommand();
    cmd.fromCommitted = cmd.fromPending = true;

    while( true ) {
      int ev = parser.nextEvent();
      if( ev == JSONParser.STRING ) {
View Full Code Here

  /**
   * @since solr 1.3
   */
  void processDelete(UpdateRequestProcessor processor, XMLStreamReader parser) throws XMLStreamException, IOException {
    // Parse the command
    DeleteUpdateCommand deleteCmd = new DeleteUpdateCommand();
    deleteCmd.fromPending = true;
    deleteCmd.fromCommitted = true;
    for (int i = 0; i < parser.getAttributeCount(); i++) {
      String attrName = parser.getAttributeLocalName(i);
      String attrVal = parser.getAttributeValue(i);
View Full Code Here

    return addCmd;
  }

  private void delete(List<String> l, UpdateRequestProcessor processor, boolean isId) throws IOException {
    for (String s : l) {
      DeleteUpdateCommand delcmd = new DeleteUpdateCommand();
      if (isId) {
        delcmd.id = s;
      } else {
        delcmd.query = s;
      }
View Full Code Here

  }

  public void deleteDoc(Object id) {
    try {
      log.info("Deleting document: " + id);
      DeleteUpdateCommand delCmd = new DeleteUpdateCommand();
      delCmd.id = id.toString();
      delCmd.fromPending = true;
      delCmd.fromCommitted = true;
      processor.processDelete(delCmd);
    } catch (IOException e) {
View Full Code Here

  }

  public void deleteByQuery(String query) {
    try {
      log.info("Deleting documents from Solr with query: " + query);
      DeleteUpdateCommand delCmd = new DeleteUpdateCommand();
      delCmd.query = query;
      delCmd.fromCommitted = true;
      delCmd.fromPending = true;
      processor.processDelete(delCmd);
    } catch (IOException e) {
View Full Code Here

    }
  }

  public void doDeleteAll() {
    try {
      DeleteUpdateCommand deleteCommand = new DeleteUpdateCommand();
      deleteCommand.query = "*:*";
      deleteCommand.fromCommitted = true;
      deleteCommand.fromPending = true;
      processor.processDelete(deleteCommand);
    } catch (IOException e) {
View Full Code Here

  }

  DeleteUpdateCommand parseDelete() throws IOException {
    assertNextEvent( JSONParser.OBJECT_START );

    DeleteUpdateCommand cmd = new DeleteUpdateCommand();
    cmd.fromCommitted = cmd.fromPending = true;

    while( true ) {
      int ev = parser.nextEvent();
      if( ev == JSONParser.STRING ) {
View Full Code Here

  /**
   * @since solr 1.3
   */
  void processDelete(UpdateRequestProcessor processor, XMLStreamReader parser) throws XMLStreamException, IOException {
    // Parse the command
    DeleteUpdateCommand deleteCmd = new DeleteUpdateCommand();
    deleteCmd.fromPending = true;
    deleteCmd.fromCommitted = true;
    for (int i = 0; i < parser.getAttributeCount(); i++) {
      String attrName = parser.getAttributeLocalName(i);
      String attrVal = parser.getAttributeValue(i);
View Full Code Here

    assertFalse( commit.waitSearcher );
   

    // DELETE COMMANDS
    assertEquals( 2, p.deleteCommands.size() );
    DeleteUpdateCommand delete = p.deleteCommands.get( 0 );
    assertEquals( delete.id, "ID" );
    assertEquals( delete.query, null );
    assertTrue(delete.fromPending && delete.fromCommitted);

    delete = p.deleteCommands.get( 1 );
View Full Code Here

TOP

Related Classes of org.apache.solr.update.DeleteUpdateCommand

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.