You can update records in a running data store by removing standard attribute and managed value assignments.
Both elements can delete standard attribute assignments as well as managed value assignments. Note that the standard attributes or managed values are not removed from the data store; they are removed only from the specified records.
You can use both elements in the same ingestRecords operation. In this case, the wildcardDeletes request is processed before the deleteAssignments request.
Both elements are case sensitive, including the standard attribute and managed value names and their assignment values.
The deleteAssignments element of the ingestRecords operation removes individual standard attribute and/or managed value assignments from Endeca records, but does not otherwise affect the record. You can remove one or more assignments in the same request.
<ingest:ingestRecords xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09"> <ingest:deleteAssignments> <mdex:record> <primaryKeyProp>keyValue</primaryKeyProp> <propName>keyValueToRemove</propName> <!-- Other property or dimension value assignments to remove --> </mdex:record> </ingest:deleteAssignments> </ingest:ingestRecords>
<ingest:ingestRecords xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09"> <ingest:deleteAssignments> <mdex:record> <partID>P123</partID> <color>red</color> <color>blue</color> <Component>crankset</Component> </mdex:record> </ingest:deleteAssignments> </ingest:ingestRecords>
The example removes two values ("red" and "blue") of the color standard attribute assignment and one managed value ("crankset") from the Component managed value assignment.
<ingest:ingestRecordsResponse xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0"> <ingest:numPropertiesCreated>0</ingest:numPropertiesCreated> <ingest:numRecordsAffected>1</ingest:numRecordsAffected> <ingest:numRecordsDeleted>0</ingest:numRecordsDeleted> </ingest:ingestRecordsResponse>
The numRecordsAffected element in the response shows that one record was successfully modified.
The wildcardDeletes element of the ingestRecords operation removes all assignments from the same standard attribute or managed value at once.
<ingest:ingestRecords xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09"> <ingest:wildcardDeletes> <mdex:record> <primaryKeyProp>keyValue</primaryKeyProp> <propToRemove /> <!-- Other property or dimension value assignments to remove --> </mdex:record> </ingest:wildcardDeletes> </ingest:ingestRecords>
Note that unlike the deleteAssignments usage, the wildcardDeletes element requires that the propToRemove specification cannot have an assignment value. Only the name of the standard attribute or managed value can be specified.
<ingest:ingestRecords xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09"> <ingest:wildcardDeletes> <mdex:record> <partID>P123</partID> <color/> <sizes/> </mdex:record> </ingest:wildcardDeletes> </ingest:ingestRecords>
In the example, if record P123 had six assignments from the color standard attribute, then all six assignments would be removed; if it had three assignments from the sizes standard attribute, all three would be removed.
If successful, the operation returns the same ingestRecordsResponse as a deleteAssignments request.