1

I want to skip update of particular field in solr document.

I am importing data from csv to solr. added one extra field "RecCount" from managed schema as follows:

Case 1: If i set default value

<field name="RecCount" type="pint" indexed="true" stored="true" default="0"/>

when i re import data then previous value of RecCount field reset to 0 which i don't want if it is 5 then it need not to be update.

Case 2: if no default value

<field name="RecCount" type="pint" indexed="true" stored="true" />

in this case when i re-import data "RecCount" field is not getting added to document

Import shell script as follows :

wget "$1" -O $DOWNLOADFILE
$SOLR_URL -c $SOLR_CORE $DOWNLOADFILE

What is the way to skip update of RecCount field?

Deepali Jadhav
  • 540
  • 2
  • 8
  • 18
  • So what is your _actual update_ request? It seems like you're just sending the same index request to Solr, and not asking for an update. If you want to _update a document_ (and not index a new one over the old one), you [have to format your requests in a specific way](https://lucene.apache.org/solr/guide/8_5/updating-parts-of-documents.html). – MatsLindh Jun 16 '20 at 13:14

1 Answers1

1

The csv index handler allows to set a parameter called "skip" which takes the field names to skip during import.

https://lucene.apache.org/solr/guide/8_5/uploading-data-with-index-handlers.html#csv-update-parameters

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
defonion
  • 121
  • 2