Term Index

In this section:

iWay Enable supports the use of a search engine as part of its event discovery functionality. In order to enable search capabilities, events must be run through an indexing process.

The Term Index is an organized view of data captured in real-time by using the _EINDEX() iFL function. The following is a list of definitions that are used:

In iWay Enable, you can use Indexing as a way to associate terms with events. This association creates Implicit Event Relationships. There are two types of relationships in iWay Enable: implicit and explicit.

Explicit Event Relationships are events which are related by correlation id (usually done using either the _EXPOSER or _EXPOSECT iFL functions). These relationships get created because they all occurred within the same message or within the same _ERULE() function call. Most importantly these relationships are persisted in the iWay Enable metadata database and are used when aggregating.

Implicit Event Relationships are events which are related either by indexed terms or name-spacing (typing). These events are not persisted and are results of queries to the real-time database.

You use implicit event relations to help learn more about real-time business data. Implicit event relations can help discover explicit relationships that did not occur within a single message but across multiple messages. They can discover new business domains and provide you with new questions about your business which in-turn can generate new events. They can give you clues to improve or discover problems with your real-time rules.


Top of page

x
Using EINDEX

Use the following EINDEX inside a Rule:

script.eindex('myevent','myterm','myapplication','mycomponent');

For iFL:

_EINDEX('myevent','myterm','myapplication','mycomponent')

If you want two index terms, it is best that you do so after an _EXPOSER or _EXPOSECT call. This will make the Term Index more helpful when analyzing implicit event relations.

For example, inside a Rule:

script.exposect('nokia-phones',cid);
script.eindex('myevent','myterm','myapplication','mycomponent');

For iFL:

_EXPOSECT('nokia-phones','mycid');
_EINDEX('myevent','myterm','myapplication','mycomponent')

To demonstrate the iWay Enable Term Index, you can use the deployed version of the CCC demo with a clean index and the completion of both the Rules and the Event Cloud sections.



x
Procedure: How to Activate Indexing

To activate indexing for iWay Enable:

  1. Click on the Index tab on the iWay Enable Settings page.
  2. Highlight the On button and click Reset, as shown in the following image.

  3. From the Views page, click on the Term Index tab, as shown in the following image.

    Note: If you had data before, clicking the Reset button will clear the data leaving only the enable node in the index tree.

  4. Ensure that the CCC listener is running, and then from the Services page, double-click ccc.rearm, or navigate to the CCC demo dashboard and click reload.

    You can return to the Term Index tab, which now includes two additional nodes in the index tree, as shown in the following image.


Top of page

x
Analyzing CCC

After a call to script.exposect, there are three calls to script.eindex which performs an EINDEX on three different terms:

All three terms will get associated with lg-phones. Every index term will also get placed in the phone application. Each term gets its own component. The $ is PC, //MT is MT, and //SP gets SP.

The following image shows the rule isLgPhone under the ccc rule set.

Running the demo will create the following node in the Index Tree:

Applications are placed at the root and Components are placed within an Application. The $ value is being consumed by the condition of the rule. To see the condition, click the PC node, since it is the component assigned to the $ in the script.eindex call.

In the following image, the index tree on the left pane is populated with every input value which $ was assigned.

Most of these terms are not associated to lg-phones because the Application and Components are reused for other phone types. For example, the term on the second row 'ipodtouchv316gbbla' is not an LG phone but an iPOD touch. The count column indicates the number of times the $ was set to the value 'ipodtouchv316gbbla'. The events column indicates how many events the term was associated with. Clicking the second row will reveal details of this term on the bottom panel.

The pie chart below, shows the percentage (since last purge) of the associated events relative to each other.

Clicking on an event name, for example 'apple-phones', shows search terms and queries which can be used in an _ESEARCH call, as shown in the following image.

Since the CCC demo talks about LG phones, you can find a term to which it is associated.

Click the count column on the Term table until it sorts the rows so that the value in count is descending. Clicking on the term 'lgkp500cookieblack' shows two events to which it is associated (lg-phones and all-phones), as shown in the following image.

These two events are considered to have an implicit relationship. By definition, all phones would include the lg-phone. The term, although, gives information about the phone itself. The terms 'black' and 'cookie' give properties of the phone that are not currently captured. The new event domain, ‘phone color’ has been created. If you want to count the number of 'black' phones, you can add a rule to your existing rule set and expose an event called BLCK-PH for every phone with the text 'black' in the PC field. The rule engine will create an explicit relation between lg-phone and blck-ph.

You will be able to count how many lg-phones were black by:

_ecount('blck-ph:lg-phone')

Or how many Samsung phones were black by:

_ecount('blck-ph:samsung-phone')

Note: The ':' means relationship.


Top of page

x
Affiliates

The isFacebook rule contains an action which exposes a Facebook event and indexes three terms, as shown in the following image.

These are the same terms discussed earlier (PC, MT, and SP).

In the following action, the application is aff. To analyze these terms notice the aff node of the term tree in the image below.

You will see the same terms as you did in the phone application since you are indexing the same fields of the message. Sort the count column of the term table so that it is in descending order.

If you click again on the term 'lgkp500cookieblack', you will see 10 events to which it is associated. If you exclude the ccc.affiliate event, these events would implicitly be related and not explicitly related. You can see this by going to the Event Cloud and clicking on any of the events (other than ccc.affiliate) and verifying that these events do not appear in any of each other's drilled down view.

The information above infers that all of the affiliates have sold the 'lgkp500cookieblack' phone and is probably the most popular phone during this LG phone sales promotion. This inference cannot be discovered any other way. You can click on the other terms and discover new inferences.


Top of page

x
Other Inferences

Click on the phone application and then the SP component. The SP contains the Sale Price for the phone. Search for the price 48.88. The events which have an implicit relationship are: other-phones, nokia-phones, samsung-phones, lg-phones, and all-phones, as shown in the following image.

Based from the image above, the nokia-phones, lg-phones, and samsung-phone events are not explicitly related to one another. This can be verified using the Event Cloud.

The information above indicates that these three phone events are implicitly related through the term 48.88, because all three events at one point had the value 48.88 in the SP field of the passing message.

This information identifies a potential explicit relationship. You can create a rule which exposes a new event called SP4888 where the SP value is ‘48.88’. This event will explicitly relate the three phone events (nokia-phones, lg-phones, and samsung-phones) through SP4888.


Top of page

x
_ESEARCH() Function

The _ESEARCH() iFL function returns events which are associated to the search query. The following image shows search terms and queries which the ccc.amazon event is associated.

The following example, will return a set of events all related implicitly through the application aff and the term 19.56, one of which will be ccc.amazon.

_ESEARCH(application:aff content:19.56)

Use this search function in the Infoset to obtain a set of implicitly related events.


Top of page

x
Using the iFL Shell for Testing

The following are iFL shells used for testing in iWay Service Manager.



x
ESEARCH
Enter command:>tools testfuncs<default/>
funcs->_ESEARCH('application:aff content:19.56')<superroot>
   <_esearch>
      <literal>application:aff content:19.56</literal>
   </_esearch>
</superroot>
ccc.nbc|motorola-phones|rim-phones|ccc.abc|ccc.nytimes|
ccc.affiliate|other-phones|ccc.msn|ccc.bbc|ccc.facebook|
lg-phones|ccc.amazon|ccc.fox|all-phones|nokia-phones|
ccc.cnn|samsung-phones
funcs->

This will return the list of implicitly related events.



x
EINDEX
Enter command:>tools testfuncs<default/>
funcs->_eindex('myevent','myterm','myapp','mycomp')<superroot>
   <_eindex>
      <literal>myevent</literal>
      <literal>myterm</literal>
      <literal>myapp</literal>
      <literal>mycomp</literal>
   </_eindex>
</superroot>
myevent
funcs->

The following image should appear after refreshing the index.

funcs->_eindex('myevent','myterm2','myapp')<superroot>
   <_eindex>
      <literal>myevent</literal>
      <literal>myterm2</literal>
      <literal>myapp</literal>
   </_eindex>
</superroot>
myevent
funcs->

The following image should appear. Notice that since no Component was provided, the Term belongs to the Application.

The event myevent now has search queries for both myterm and myterm2, as shown in the following image.

Test the search queries using ESEARCH to ensure they return myevent.


iWay Software