DREREPLACE/Data
Type

String

Default

 

Description

The field values you want to replace or delete in IDOL server. Specify the target documents, fields, and field values as follows:

#DREALL
#DREDBNAME databaseName
#DREDOCID id or #DREDOCREF url or #DRESTATEID stateID
#DREFIELDNAME fieldName
#DREFIELDVALUE fieldValue
#DREFIELDVALUEIFNOTFOUND fieldValue
#DREFIELDVALUEIFNOFIELD fieldValue
#DREDELETEFIELDVALUE fieldValue
#DREDELETESINGLEFIELDVALUE fieldValue
#DREDELETEFIELD fieldName
#DREFIELDBITOR value (or #DREFIELDBITAND value or #DREFIELDBITXOR value)
#DREENDDATA

where,

#DREALL matches all documents. This is restricted only by the DatabaseMatch parameter supplied as part of the DREREPLACE request, or by database read-only status.

#DREDBNAME databaseName is the database or databases within which to all documents should be matched. To specify more than one database, separate them with plus signs (+). The DatabaseMatch parameter is ignored for the documents identified by #DREDBNAME.

#DREDOCID id is the ID of the document containing the field you want to change or delete.

#DREDOCREF url is the reference of the document containing the field you want to change or delete.

#DRESTATEID stateID is the stored state ID of an array of documents containing the field you want to change or delete. The stateID is returned from a query where StoreState=true.

#DREFIELDNAME fieldName is the name of the field whose value you want to change or delete. Note that in XML documents, fieldName must be fully qualified (for example, XML/DOCUMENT/MYFIELD).

#DREFIELDVALUE fieldValue is the new value for the field specified by fieldName.

#DREFIELDVALUEIFNOTFOUND fieldValue is the new value for the field specified by fieldName if the fieldName/fieldValue pair does not already exist.

#DREFIELDVALUEIFNOFIELD fieldValue is the new value for the field specified by fieldName if the fieldName does not already exist in the document.

#DREDELETEFIELDVALUE fieldValue is the value the field specified by fieldName must contain for the field to be deleted.

#DREDELETESINGLEFIELDVALUE fieldValue is the value the field specified by fieldName must contain for the first instance of the field to be deleted. Note that this deletes only a single instance of the fieldName/fieldValue pair.

#DREDELETEFIELD fieldName is the field to be deleted. Note that a #DRE*VALUE parameter is not required.

#DREFIELDBITOR value is generally a 32-bit decimal integer. If this field is a NumericType field with the NumericIntegerOnly property, then the value is a signed 64-bit integer. If the field is a BitFieldType field, the value should be a hexadecimal value. The operation is performed on the field identified by the previous #DREFIELDNAME. For NumericType fields, if the field is not present in the document, then a field is added with value 0000000000 first, and then the bit operation is applied.

#DREENDDATA must exist at the end of a command parameter block to signify the end of the data.

Notes

  •  
  • To specify multiple terms, use the following guidelines for separators:

    DREDOCREF uses unencoded plus signs (+) and unencoded spaces ( ) as separators.
    DREDOCID uses unencoded plus signs (+) and unencoded spaces as separators.
    DRESTATEID uses unencoded commas (,) as separators.

  •  
  • Percent-encode each reference once, with the exception of separators.

  •  
  • Set ReplaceAllRefs=true to perform actions upon multiple documents.

  •  
  • Replacing values in Index or ACL fields is not generally recommended because IDOL server must re-index the documents being changed, and this can slow down the update process. Changes to numerical fields, numerical date fields, or fields to which you have assigned another property, are executed without re-indexing, and so are made quickly.

    Example

    DREREPLACE?DATABASEMATCH=News+Archive HTTP/1.0\n
    Content-Length:203\n\n

    #DREDOCID 1\n
    #DREFIELDNAME Price\n
    #DREFIELDVALUE 10\n
    #DREFIELDNAME Color\n
    #DREFIELDVALUE Red\n

    #DREDOCREF http://www.autonomy.com/autonomy/dynamic/autopage442.shtml\n
    #DREFIELDNAME Country\n
    #DREFIELDVALUE UK\n
    #DREFIELDNAME Region\n
    #DREFIELDVALUE South East\n
    #DREFIELDNAME OnSale\n
    #DREDELETEFIELDVALUE Yes\n

    #DRESTATEID abcdefg-6\n
    #DREFIELDNAME Fruit\n
    #DREFIELDVALUEIFNOTFOUND mango\n
    #DREDELETESINGLEFIELDVALUE apple\n
    #DREDELETEFIELD XML/DOC/DELETEME\n

    #DREENDDATANOOP\n\n


    In this example, the DREREPLACE makes the following changes in the News and Archive databases.

    • In the document with the ID 1:
      • The value of the Price field is changed to 10.
      • The value of the Color field is changed to Red.

    • In the document with the reference http://www.autonomy.com/autonomy/dynamic/autopage442.shtml:
      • The value of the Country field is changed to UK.
      • The value of the Region field is changed to South East.
      • The field OnSale is removed from the document if it has the value Yes.

    • In the document(s) referenced in the state ID abcdefg-6:
      • The value of the Fruit field is changed to mango if the Fruit/mango pair does not already exist.
      • If the Fruit field contains the value apple, a single instance of the Fruit/apple pair is deleted.
      • All instances of the XML/DOC/DELETEME field are deleted.

    • #DREENDDATANOOP marks the end of the command parameters.