Search code examples
mysqlsolrlucenedataimporthandlerdih

Solr - Data Import Handler - Full Import - Clean=False by default?


Version: apache-solr-3.5.0

For full imports, you can set a url param clean=false.

However, can 'clean' be set to 'false' as a default, somewhere like the XML configs, or something?

If not, can full imports be disabled in any way?

Thanks!


Solution

  • You can configure the clean default value within your solrconfig.xml, in the DataImportHandler section like this:

    <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
        <lst name="defaults">
            <str name="config">solr-data-config.xml</str>
        </lst>
        <lst name="invariants">
            <str name="clean">false</str>
        </lst>
    </requestHandler>
    

    Have a look here: 'invariants' means that you cannot change it later, while defaults is just a default that you can overwrite at request time.

    I don't think you can disable the full-import since that's a command, not just a parameter.