; This is an example CSV import configuration. It contains several kinds of sections: ; ; [General] - Global settings controlling behavior ; [Column:#] - Where "#" is an index, starting at 0 for the first column; controls ; how individual columns are processed ; [Field:name] - Where "name" is the name of a Solr field; controls how data added ; to that field is processed ; ; Settings supported by each type of section are detailed in the examples below. ; ; More information about CSV indexing can be found in the wiki: ; https://vufind.org/wiki/indexing:csv [General] ; This setting controls how the first row of the CSV will be processed; there are ; three options: ; - fields: the header row contains the names of index fields; use it to map data ; (note that [Column:#] and [Field:name] sections can still be used to ; extend behavior) ; - none: there is no header row; treat the first row as data [default behavior] ; - skip: ignore the header row header = none ; This setting controls how many rows will be held in memory before being written ; to Solr. The higher the number, the greater the importer's memory utilization, ; but the faster the importing process will complete. You can tune this based on ; the size/complexity of your input data. batchSize = 100 ; This setting specifies the character encoding of the CSV input file; default ; is UTF-8. Supported values: ISO-8859-1, UTF-8; other encodings supported by ; PHP's iconv() function may work, but some are known to fail (e.g. UTF-16). To ; import a file from an unsupported encoding, simply convert the file before ; running the ingest process (e.g. iconv -f UTF-16 -t UTF-8 bad.csv > good.csv). encoding = "UTF-8" ;[Column:0] ; This setting specifies the Solr field that this column will be mapped to; you ; can also use a series of field[] settings to copy the value(s) to multiple ; destinations. ;field = example_str ; If the column contains multiple delimited values, you can uncomment this setting ; to split them on the specified delimiter. Use the value PHP_EOL (without quotes) ; to split multi-line fields on line breaks. ;delimiter = "|" ;[Field:example_str] ; The callback setting specifies one or more callbacks that will be used to process ; each value before it is sent to the field. You can omit the setting if no special ; processing is needed. ; ; Callback values can be a PHP function, or a static class method represented using ; class_name::method_name syntax. ; ; It is assumed by default that each callback function accepts one parameter: the ; value to manipulate, which will always be a string. If you need to provide ; additional parameters, you can provide an argument list, using a mix of hard-coded ; values, and special tokens that start and end with $$. ; ; These are the supported special tokens: ; $$csv$$ - the current value from the CSV file ; $$field:[fieldname]$$ - all values extracted for the field [fieldname] ; $$fieldFirst:[fieldname]$$ - the first value extracted for the field [fieldname] ; ; When using the [fieldname] option, make sure that the target field's [Field:xxx] ; section precedes the dependent field's [Field:xxx] section in this configuration, ; to ensure that values are available when they are needed. See the second example ; below. Also note that the CSV lines will be processed from left to right, which ; may limit your ability to combine values from multiple fields; for example, if ; your CSV contains values for field1 followed by values for field2, you can make ; references to field1 in the section processing field2, but you cannot do the ; reverse. ; ; Callback functions must return either a string or an array of strings. ; ; The callbacks will be processed in the order listed, with each subsequent callback ; processing the output of the previous callback. When one callback returns an array, ; the next callback in sequence will be passed each value from that array separately ; as a single string. Callbacks can return an empty array if they wish to omit values ; from further processing. ;callback[] = '\My\Indexing\Class::myFunction' ;callback[] = '\VuFind\XSLT\Import\VuFind::getFirstIndexed(biblio, $$csv$$, $$fieldFirst:modified_str$$)' ; You can use this setting to hard-code values into the field, rather than pulling ; them from the CSV file itself. Note that these values will always be sent to the ; index unmodified; they will NOT be passed to any callbacks defined above. ;value[] = "My sample text" ; This setting can be used to pass a "seed value" to the callbacks, if no value for ; this field was mapped from the CSV columns. Without a seed value, the callbacks ; will not run, so this is required if you wish to create fields that derive their ; values from other fields using callbacks. In all other scenarios, you should omit ; this setting, as it will be ignored. ;callbackSeed[] = ""