This page documents an earlier version of the API client. For the latest version, see Create an A/B test.
Required ACL:editSettingsYou can set an A/B test on two different indices with different settings,
or on the same index with different search parameters by providing a customSearchParameters setting on one of the variants.
var abTest = new ABTest{ Name = "myABTest", Variants = new List<Variant> { new Variant { Index = "indexName1", TrafficPercentage = 90, Description = "a description" }, new Variant { Index = "indexName1-alt", TrafficPercentage = 10, Description = "a description" } }, EndAt = DateTime.UtcNow.AddDays(1)};// Add a new A/B TestAnalyticsClient analytics = new AnalyticsClient("YourApplicationID", "YourWriteAPIKey");analytics.AddABTest(abtest);// Asynchronousawait analytics.AddABTestAsync(abtest);
The estimated number of searches that will need to be run to achieve the desired confidence level and statistical power.
A minimumDetectableEffect must be set in the configuration for this to be used.
The smallest relative difference between the variants that you want to detect.
For example, to detect a 10% difference between the variants,
set this to 0.1. The size must be between 0 and 1.
This section shows the JSON response returned by the API.
Each API client wraps this response in language-specific objects, so the structure may vary.
To view the response, use the getLogs method.
Don’t rely on the order of properties—JSON objects don’t preserve key order.