Identifying records with EQL

To identify one or more records you want to update or delete, you use EQL expressions.

About the record set specifier

Several ingestChanges operations that update or delete existing records require a record set specifier to determine the set of records to operate on. The record set specifier is evaluated from an EQL expression inside the recordSpecifier element of the operation.

The EQL expressions use one or more record attributes that identify a set of records that will be updated or deleted by the operation. The record attributes specified in the EQL expression can be any attribute on a record, including the record's primary-key attribute.

Note, however, that the primary-key attribute does have to be used in the EQL expression. For example, assume that your records have an attribute named "color" with values such as "red", "blue", and so on. You can then use an EQL expression that specifies that all records that have a "color=red" assignment will be deleted.

Keep in mind that an EQL expression can also be evaluated to identify zero records, in which case the operation will be performed but no updates or deletes will be actually be done. In this case, the numRecordsAffected element in the ingestChangesResponse will show that 0 (zero) records were affected.

For full information on EQL syntax, see the Oracle Endeca Server EQL Guide.

Identifying a single record with EQL

This example contains a recordSpecifier element with the EQL syntax that identifies a single record. In this data set, the primary-key attribute is the attribute named partID of type string. The following expression identifies a record with the primary key P123:
<recordSpecifier>"partID" = 'P123'</recordSpecifier>
where
"partID" ='P123'
is an EQL expression on a string value.
Similarly, if the primary-key attribute is the attribute named modelNum of type integer, then the EQL expression for identifying a record with the primary key 45 is:
<recordSpecifier>"modelNum" = 45</recordSpecifier>
Note: While these examples illustrate how to utilize a primary-key attribute in EQL, you can use an EQL expression on any attribute in your data set when updating or deleting records. When adding new records, you identify them by the EQL expression that specifies the values for the primary-key attribute and not any other attribute.

Identifying multiple records with EQL

This example identifies all records for which the value of the integer attribute Num is greater than 45:
<recordSpecifier>"Num" > 45</recordSpecifier>
The following example identifies those records for which the value of the attribute price (of type double) is greater than 19.99 and less than 49.99, non-inclusive:
<recordSpecifier>("price" &gt; 19.99) AND ("price" &lt; 49.99)</recordSpecifier>
Note: The greater than and less than signs in this example are escaped to ensure that the XML syntax of this request can be successfully parsed.
In this example, the EQL expression identifies those records for which assignment values exist on the attribute tag:
<recordSpecifier>"tag" IS NOT NULL</recordSpecifier>
The examples above assume that the attribute to be compared is a single-assign attribute. For multi-assign attributes, make sure you use the functions and operators that work with sets, as in this example:
<recordSpecifier>SOME i IN NumRevs SATISFIES (i > 45)</recordSpecifier>

For more information on using multi-assign attributes with EQL, see the Oracle Endeca Server EQL Guide.

Setting a language ID for EQL error messages

If the syntax of an EQL expression is incorrect, the Data Ingest Web Service returns an EQL syntax error message. The ingestChanges complex type has an optional Language element that lets you set the language in which EQL error messages are returned. The element looks like this:
<ns:ingestChanges>
   <!--Optional:-->
   <ns:OuterTransactionId>?</ns:OuterTransactionId>
   <!--Optional:-->
   <ns:Language>en</ns:Language>
   <!--Zero or more repetitions:-->
   <ns:updateRecords>
   ...
   </ns:updateRecords>
   ...
</ns:ingestChanges>
The supported languages and their corresponding language IDs are:
  • Chinese (simplified): zh_CN
  • Chinese (traditional): zh_TW
  • English: en
  • French: fr
  • German: de
  • Italian: it
  • Japanese: ja
  • Korean : ko
  • Portuguese: pt
  • Spanish: es

The en (English) language ID is the default.