Solr
  1. Solr
  2. SOLR-801

configurable delete query per root-entity

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Labels:
      None

      Description

      Now on a full import DIH deletes : which is a problem if I have different root entities .

      Suggest having a deleteByQuery attribute for each root entity so that cleanup can issue a different query instead of :

      1. SOLR-801.patch
        9 kB
        Noble Paul
      2. SOLR-801.patch
        12 kB
        Shalin Shekhar Mangar
      3. SOLR-801.patch
        3 kB
        Noble Paul
      4. SOLR-801.patch
        2 kB
        Shalin Shekhar Mangar

        Activity

        Hide
        Hoss Man added a comment -

        perhaps a preFullBuildDeleteQuery and a postFullBuildDeleteQuery ... somepeople might want to delete all existing entities before starting a full build – others might want to wait until after the full build to delete old stuff (anything that hasn't been updated in since NOW-1DAY for example)

        Show
        Hoss Man added a comment - perhaps a preFullBuildDeleteQuery and a postFullBuildDeleteQuery ... somepeople might want to delete all existing entities before starting a full build – others might want to wait until after the full build to delete old stuff (anything that hasn't been updated in since NOW-1DAY for example)
        Hide
        Noble Paul added a comment -

        OK .makes sense .Let us make it
        preImportDeleteQuery and
        postImportDeleteQuery

        delta import also use the same query. By default delta-import does not do delete (unless clean=true is passed in request param)

        Show
        Noble Paul added a comment - OK .makes sense .Let us make it preImportDeleteQuery and postImportDeleteQuery delta import also use the same query. By default delta-import does not do delete (unless clean=true is passed in request param)
        Hide
        Noble Paul added a comment -

        per root-entity preImport deletes are common .while the post import delete queries are rare. So chosen to name the pre import query as deleteByQuery.

        Show
        Noble Paul added a comment - per root-entity preImport deletes are common .while the post import delete queries are rare. So chosen to name the pre import query as deleteByQuery.
        Hide
        Noble Paul added a comment -

        deleteByQuery per root entity is implemented

        Show
        Noble Paul added a comment - deleteByQuery per root entity is implemented
        Hide
        Shalin Shekhar Mangar added a comment -

        Bringing patch in sync with trunk. No other changes.

        Show
        Shalin Shekhar Mangar added a comment - Bringing patch in sync with trunk. No other changes.
        Hide
        Noble Paul added a comment -

        Brought uptodate w/ trunck and code simplified
        The attribute names are

        • preImportDeleteQuery
        • postImportDeleteQuery
        Show
        Noble Paul added a comment - Brought uptodate w/ trunck and code simplified The attribute names are preImportDeleteQuery postImportDeleteQuery
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 737555.

        Thanks Noble!

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 737555. Thanks Noble!
        Hide
        Shalin Shekhar Mangar added a comment -

        Re-opening due to failed tests. I'll attach a fix shortly.

        Show
        Shalin Shekhar Mangar added a comment - Re-opening due to failed tests. I'll attach a fix shortly.
        Hide
        Shalin Shekhar Mangar added a comment -

        Patch for the fix:

        1. If deleteQuery is null, call SolrWriter.doDeleteAll. Since deleteQuery is already set to "* : *" in execute method, it is never null.
        Show
        Shalin Shekhar Mangar added a comment - Patch for the fix: If deleteQuery is null, call SolrWriter.doDeleteAll. Since deleteQuery is already set to "* : *" in execute method, it is never null.
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 737652.

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 737652.
        Hide
        Shalin Shekhar Mangar added a comment -

        I encountered a NPE in case of multiple root entities when deleteQuery is not specified.

        Committed revision 747343.

        Show
        Shalin Shekhar Mangar added a comment - I encountered a NPE in case of multiple root entities when deleteQuery is not specified. Committed revision 747343.
        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:
            Shalin Shekhar Mangar
            Reporter:
            Noble Paul
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development