GenerateCloudSearchData Class

Summary

Generates bulk JSON upload data to get documents into Amazon CloudSearch.
Assembly
Wyam.AmazonWebServices.dll
Namespace
Wyam.AmazonWebServices
Interfaces
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IModule"] click Interface0 "/api/Wyam.Common.Modules/IModule" Type["GenerateCloudSearchData"] class Type type-node

Syntax

public class GenerateCloudSearchData : IModule

Examples

Pipelines.Add("CloudSearchData",
    Documents("NameOfAPriorPipeline"),
    GenerateCloudSearchData("Id", "Body")
       .AddField("type", "post")
       .AddField("length", d => d.Content.Count())
       .MapMetaField("title", "Title")
       .MapMetaField("tags", "Tags", o => o.Split(",".ToCharArray())),
    Meta("WritePath", "cloudsearch_data.json"),
    WriteFiles()
);

Remarks

This module creates a single document from a pipeline with JSON data containing the correctly formatted commands for Amazon CloudSearch. Note that this just creates the document. Once that document is written to the file system, you will still need to upload the document to a correctly configured CloudSearch instance using the API or Amazon CLI.

Constructors

Name Summary
GenerateCloudSearchData(string, string) Generates Amazon CloudSearch JSON data.

Methods

Name Value Summary
AddField(string, Func<IDocument, Object>) GenerateCloudSearchData
Adds a function-based field value. The function will take in a document and return an object, which will be the field value.
AddField(string, Object) GenerateCloudSearchData
Adds a literal field value.
Execute(IReadOnlyList<IDocument>, IExecutionContext) IEnumerable<IDocument>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
MapMetaField(string, string, Func<Object, Object>) GenerateCloudSearchData
Adds a mapping from meta key to CloudSearch field. When provided, the contents of the meta key will be written to the provided field name.
GitHub