Stream File Dataflow - Append and Delete in One

There are many ways to use Raptor's Data Manager to your advantage - and with regular updates and additions to the system, new ones frequently open up. This guide will illustrate a particularly slick and efficient Site Search setup enabled by the addition of the Delete Schema.

Source: JSON Streaming File

For this trick, you need a Streaming API datasource. In this case, a product-catalog, kept steadily updated with additions, price-changes, in-stock numbers and other such factors. As such, you'll start by creating a Dataflow with Source: Product Feed and Destination Platform: Search.

Select the Streaming File download-option, linking to the Product Catalog in question. Then, at the File Mapping step, you'll want to check the Ignore missing columns? box. This is crucial for fully granular updates of the Dataflow.

Single Dataflow Delete 1

Schema: Append and Delete

In the Transform & Map stage, you will - as usual - need to add a suitable Schema. In this case, a Search Schema, suited for your Product Feed data. If you don't have a viable Schema already, see this guide for more information on how to make one. You can also simply use the Create Schema based on downloaded columns option, and make one right then and there! Either way, you'll want to leave this Schema on, essentially, default settings: Write and Append.

Single Dataflow Delete 2

In this Schema, map all your columns - or as many as possible - as normal. The Introduction to the Data Manager has details on how to do this, if needed. This, already, will produce a Product Feed that is constantly appended by changes to the source, suited for creating a fine Site Search Index. However, while it can update and add data to the final Index, it cannot remove it...

Hence, you need to add a second Schema. Select the same Schema you already used, but switch to Delete mode!

This results in a red-painted Schema with only a single column to map - the Product ID. Once you've done so, it should look something like this:

Single Dataflow Delete 3

One important step remains, however: Setting up the Columns Filter for the Delete Schema. This Schema will delete any line that matches its criteria, which means that without a filter, it will effectively negate the entire Dataflow - generally rather unhelpful! In this example, we'll be using the function to remove any out-of-stock items from the search results, but if you have some other conditions under which you'd like products to stop appearing in Site Search, it's simply a matter of making a Filter for it.

Note that if you are using a converted Boolean datapoint, it'll always be on the format 'True/False'. Of course, this could just as easily be an exact stock-number, set to filter when it Equals 0. Either way, your Delete Schema now has a filter, making it actually useful...

All that remains, then, is to Activate the Dataflow - for a Stream File source, the 'scheduling' step is essentially skipped, since it will simply run continuously.

Site Search: Create Search Index

Finally, you simply create a Search Index in the Site Search section of the site, selecting the same Schema you just set up the Dataflow for. More details on how to do this can be found in this guide.

The end result, thus, should be a fully up-to-date and personalized Site Search Index, fed by a single, compact Dataflow. Products will be updated, adjusted, and deleted as soon as they go out of stock, then reappear when they're again available, all without needing multiple overlapping dataflows. Naturally, this approach can be used in many other ways as well...