editSettings
Usage
Report incorrect code
Copy
// Initialize the client
var client = new CompositionClient(
new CompositionConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);
// Call the API
var response = await client.MultipleBatchAsync(
new BatchParams
{
Requests = new List<MultipleBatchRequest>
{
new MultipleBatchRequest
{
Action = Enum.Parse<Action>("Upsert"),
Body = new BatchCompositionAction(
new Composition
{
ObjectID = "my-compo",
Name = "my composition",
Behavior = new CompositionBehavior
{
Injection = new Injection
{
Main = new Main
{
Source = new CompositionSource
{
Search = new CompositionSourceSearch { Index = "foo" },
},
},
InjectedItems = new List<InjectedItem>
{
new InjectedItem
{
Key = "my-unique-injected-item-key",
Source = new InjectedItemSource(
new SearchSource
{
Search = new Algolia.Search.Models.Composition.Search { Index = "foo" },
}
),
Position = 2,
Length = 1,
},
},
Deduplication = new Deduplication
{
Positioning = Enum.Parse<DedupPositioning>("Highest"),
},
},
},
}
),
},
},
}
);
// >LOG
See the full API reference
For more details about input parameters
and response fields.