Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-3432

deleteByQuery silently ignored if updateLog is enabled, but {{_version_}} field does not exist in schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.0-ALPHA, 4.0-BETA
    • 4.0, 6.0
    • None
    • None
    • Tomcat 7

    Description

      deleteByQuery is silently ignored if there the updateLog is configurd in solrconfig.xml, but there is no _version_ field in the schema.xml (ie: if someone copies the example configs, and then prunes down the schema to remove fields they don't think they need/want)

      To reproduce:

      • comment out _version_ in example schema
      • java -jar start.jar
      • java -Ddata=args -jar post.jar '<add><doc><field name="id">HOSS</field></doc></add>'
      • java -Ddata=args -jar post.jar '<delete><query>id:HOSS</query></delete>'
        • or: java -Ddata=args -jar post.jar '<delete><query>*:*</query></delete>'

      Note in the logs that SolrCore logs the deleteByQuery, but there is no log of it executing...

      May 3, 2012 4:36:24 PM org.apache.solr.update.processor.LogUpdateProcessor finish
      INFO: [collection1] webapp=/solr path=/update params={} {deleteByQuery=*:*} 0 41
      

      Workarround: add this ield to your schema.xml...

         <field name="_version_" type="long" indexed="true" stored="true"/>
      

      Attachments

        1. SOLR-3432.test.patch
          1 kB
          Chris M. Hostetter
        2. web.xml
          6 kB
          David Boychuck
        3. solr.xml
          2 kB
          David Boychuck
        4. solrconfig.xml
          65 kB
          David Boychuck
        5. schema.xml
          58 kB
          David Boychuck

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              dboychuck David Boychuck
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: