Solr
  1. Solr
  2. SOLR-976

deleteByQuery is ignored when deleteById is placed prior to deleteByQuery in a <delete>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      Due to the following if block, deleteByQuery cannot be executed. cmd.id and cmd.query should be set to null when UpdateProcessor chain is finished.

      RunUpdateProcessor
      public void processDelete(DeleteUpdateCommand cmd) throws IOException {
        if( cmd.id != null ) {
          updateHandler.delete(cmd);
        }
        else {
          updateHandler.deleteByQuery(cmd);
        }
        super.processDelete(cmd);
      }
      
      1. SOLR-976.patch
        0.5 kB
        Koji Sekiguchi

        Activity

        Hide
        Hoss Man added a comment -

        the patch makes sense – XMLLoader is at fault for not clearing out those variables before reusing the DeleteUpdateCommand .. but i'm curious if people think it would also make sense to make DeleteUpdateCommand and RunUpdateProcessor more forgiving in cases where both id and query are set, is there any reason not to execute them both?

        or at the very least: RunUpdateProcessor can log an error if both are set.

        Show
        Hoss Man added a comment - the patch makes sense – XMLLoader is at fault for not clearing out those variables before reusing the DeleteUpdateCommand .. but i'm curious if people think it would also make sense to make DeleteUpdateCommand and RunUpdateProcessor more forgiving in cases where both id and query are set, is there any reason not to execute them both? or at the very least: RunUpdateProcessor can log an error if both are set.
        Hide
        Mark Miller added a comment -

        My Opinion: it should clear both (this patch), and also execute both if both are set. It makes as much or more sense than one wins over the other.

        Show
        Mark Miller added a comment - My Opinion: it should clear both (this patch), and also execute both if both are set. It makes as much or more sense than one wins over the other.
        Hide
        Koji Sekiguchi added a comment -

        Hoss, Mark, thank you for your comments. I'll commit the patch shortly.

        Show
        Koji Sekiguchi added a comment - Hoss, Mark, thank you for your comments. I'll commit the patch shortly.
        Hide
        Koji Sekiguchi added a comment -

        Committed revision 742106.

        Show
        Koji Sekiguchi added a comment - Committed revision 742106.
        Hide
        Grant Ingersoll added a comment -

        Bulk close for Solr 1.4

        Show
        Grant Ingersoll added a comment - Bulk close for Solr 1.4

          People

          • Assignee:
            Koji Sekiguchi
            Reporter:
            Koji Sekiguchi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development