Skip to content

Instantly share code, notes, and snippets.

@allenmichael
Created December 10, 2015 16:58
Show Gist options
  • Save allenmichael/136d35689f53d8ddc9c8 to your computer and use it in GitHub Desktop.
Save allenmichael/136d35689f53d8ddc9c8 to your computer and use it in GitHub Desktop.
Adding a custom field.
[TestMethod]
public void Search_Results()
{
var searchTuningResource = new Mozu.Api.Resources.Commerce.Catalog.Admin.SearchResource(_apiContext);
var settings = searchTuningResource.GetSettingsAsync().Result;
settings.SiteSearchSettings[0].CustomFields.Add(
new SiteSearchRelevancyCustomField()
{
FieldName = "tenant~best-use",
FieldWeight = 3
}
);
var result = searchTuningResource.UpdateSettingsAsync(settings).Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment