Adding attributes is based on mapping existing structure attributes onto the new ones – e.g case doc.id -> doc.region. The main script is called add_fields.sh and work as follows:
add_fields.sh <corpname> <struct> <src_attr> <new_attrname> <map_file> [<tmpdir>]
e.g. corpname=biwec, struct=doc, src_attr=id, new_attrname=region and tmpdir is path to a directory that is used for saving temporary data (/tmp by default). map_file is a name of the file with mapping from src_attr (e.g. doc.id) to new_attr (e.g. doc.gdex or doc.region) – the script expects TAB-delimited text file with one pair of attributes on each line. The script creates encoded data for the new attribute and copies them in the right place; then, the config file has to be manually modified to add the new attribute.
The script codes are attached to this page – both files must be placed in the same directory before running add_fields.sh . They can also be found on loft servers, in /home/xkovar3/add_fields/src .
scripts_header_fields (zip archive)