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 |
---|---|
Generate |
Generates Amazon CloudSearch JSON data. |
Methods
Name | Value | Summary |
---|---|---|
AddField |
Generate |
Adds a function-based field value. The function will take in a document and return an object, which will be the field value.
|
AddField |
Generate |
Adds a literal field value.
|
Execute |
IEnumerable |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
|
MapMetaField |
Generate |
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.
|